Skip to main content
. 2022 May 3;22(9):3485. doi: 10.3390/s22093485
Algorithm 1. MCC-CycleGAN training process. The pseudocode of the proposed network training process.
1: Input: hyperparameters (batch size k, epochs e, times of generator training n, learning rate r), location of dataset A and B
2: Establish and initialize models: GA, GB, DA, DB and C, setup optimizer: Adam,
Load training dataset A  and B , samples aA and samples bB
3: For epoch=1 to e do
4: For t=1 to n do
5: Train GA and GB: freeze parameters of DA and DB, generate fake images
img_gA=GA(b) and img_gB=GB(a), compute lossGA, lossGB based
on Equation (2), and losscycle based on Equation (3), then update parameters of
model GA and   GB
6: end for
7: Train DA and DB: freeze parameters of GA and GB, generate fake images
img_gA=GA(b) and img_gB=GB(a), compute lossGA, lossGB based on
Equation (2), then update parameters of model DA and   DB
8: Train C: compute the input fusion image imgmix based on Equation (8), feed
imgmix into C, compute losscritic based on Equation (4), then update parameters
of model C
9: end for