December 2019
Intermediate to advanced
468 pages
14h 28m
English
At this point, we usually implement the train method, but because CycleGAN has more components, we'll show you how to build the entire model. First, we instantiate the data_loader object, where you can specify the name of the training set (feel free to experiment with the different datasets). All the images will be resized to img_res=(IMG_SIZE, IMG_SIZE) for the network input, where IMG_SIZE = 256 (you can also try 128 to speed up the training process):
# Input shapeimg_shape = (IMG_SIZE, IMG_SIZE, 3)# Configure data loaderdata_loader = DataLoader(dataset_name='facades', img_res=(IMG_SIZE, IMG_SIZE))
Then, we'll define the optimizer and the loss weights:
lambda_cycle = 10.0 # Cycle-consistency losslambda_id = 0.1 ...
Read now
Unlock full access