Skip to main content
. 2022 Dec 8;22(24):9628. doi: 10.3390/s22249628
Algorithm 1. Ad CycleGAN Optimization
1: for number of epochs do
2:      for number of batches do
3:          Sample minibatch xii=1mX
4: Sample minibatch yjj=1mY
5:          Generate m synthetic samples of Gxand Fy
6:  synthetic X: X Gx
7:  synthetic Y: Y Fy
8:          Compute the Adversarial loss
9:   LGANG,DY, X,Y=Ey~pymlogDYy+Ex~pxmlog1DYGx
10:   LGANF,DX, Y,X=Ex~pdataxlogDXx+Ey~pdataylog1DXFy
11:          Generate m cycle sample of FGxand GFy
12:  Cycle X: GxFGx
13:  Cycle Y: FyGFy
14:          Compute the Cycle loss
15: LcycG,F=Ex~pxmFGxx1+Ey~pymGFyy1
16:           Generate m identical sample of Fxand Gy
17:  identical X:X Fx
18:  identical Y:Y Gy
19:          Compute the identity loss
20: LidenG,F=Ex~pxmFxx1+Ey~pymGyy1
21:          Compute the criterion loss for cycle sample: Lccycle
22:          Compute the criterion loss for identical sample: Lcidentity
23:          Compute the total generator loss
24:  Ltotal=[LGANG,DY, X,Y+LGANF,DX, Y,X]+λLcycleG,F+λLidenG,F+κ(φLc)
25          Update the Discriminator DX and DY
26:  maxDXLGANF, DX, X, Y
27:  maxDYLGANG, Dy,X, Y
28:           Update the Generators G, F
29:  minG,FLG,F,DX, DY
30:    end do
31: end do