January 2019
Intermediate to advanced
316 pages
8h 16m
English
As discussed earlier in this chapter in the An Introduction to CycleGANs section, CycleGANs have two network architectures, a generator and a discriminator network. In this section, we will write the implementation for all the networks.
Before starting to write the implementations, however, create a Python file, main.py, and import the essential modules, as follows:
from glob import globimport matplotlib.pyplot as pltimport numpy as npimport tensorflow as tffrom keras import Input, Modelfrom keras.layers import Conv2D, BatchNormalization, Activation, Add, Conv2DTranspose, \ ZeroPadding2D, LeakyReLUfrom keras.optimizers import Adamfrom keras_contrib.layers import InstanceNormalizationfrom scipy.misc import ...
Read now
Unlock full access