Training the networks

To train the 3D-GAN, perform the following steps:

  1. Start by specifying the values for the different hyperparameters required for the training, shown as follows:
gen_learning_rate = 0.0025dis_learning_rate = 0.00001beta = 0.5batch_size = 32z_size = 200DIR_PATH = 'Path to the 3DShapenets dataset directory'generated_volumes_dir = 'generated_volumes'log_dir = 'logs'
  1. Next, create and compile both of the networks, shown as follows:
# Create instancesgenerator = build_generator()discriminator = build_discriminator()# Specify optimizer gen_optimizer = Adam(lr=gen_learning_rate, beta_1=beta)dis_optimizer = Adam(lr=dis_learning_rate, beta_1=0.9)# Compile networksgenerator.compile(loss="binary_crossentropy", optimizer="adam" ...

Get Generative Adversarial Networks Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.