Research Article
An Empirical Study on GAN-Based Traffic Congestion Attack Analysis: A Visualized Method
Algorithm 1
Iterative training of CycleGAN.
Input: original state image set , target congestion image set . | Output: trained model with optimized parameters. | Initialization. initialize network parameters , , , , learning rate , , , number of training iterations . | 1: while and has not converged do | 2: for to do | 3: //Forward cycle | 4: Generate fake image and recommend image . | 5: Calculate , loss. | 6: Update the gradient of ,: | | 7: Discriminate fake image and real image. | 8: Calculate loss. | 9: Update the gradient of : | 10: //Backward cycle | 11: Generate fake image and recommend image . | 12: Calculate , loss. | 13: Update the gradient of ,: | | 14: Discriminate fake image and real image. | 15: Calculate loss. | 16: Update the gradient of :. | 17: end for | 18:end while |
|