官术网_书友最值得收藏!

Testing the models

To test the networks, create the generator and the discriminator networks. Then, load the learned weights. Finally, use the predict() method to generate predictions:

# Create models
generator = build_generator()
discriminator = build_discriminator()

# Load model weights
generator.load_weights(os.path.join(generated_volumes_dir, "generator_weights.h5"), True)
discriminator.load_weights(os.path.join(generated_volumes_dir, "discriminator_weights.h5"), True)

# Generate 3D images
z_sample = np.random.normal(0, 0.33, size=[batch_size, 1, 1, 1, z_size]).astype(np.float32)
generated_volumes = generator.predict(z_sample, verbose=3)

In this section, we have successfully trained the generator and the discriminator of the 3D-GAN. In the next section, we will explore hyperparameter tuning and various hyperparameter optimization options.

主站蜘蛛池模板: 濮阳县| 南京市| 建阳市| 成安县| 宜君县| 锡林浩特市| 凯里市| 贵德县| 怀安县| 兴和县| 历史| 北川| 博兴县| 斗六市| 阳高县| 凯里市| 汤阴县| 桦甸市| 广河县| 泌阳县| 丹寨县| 扶余县| 韶山市| 赣州市| 冷水江市| 微山县| 莆田市| 昭苏县| 古丈县| 西峡县| 瑞安市| 徐闻县| 丹阳市| 葵青区| 谷城县| 海门市| 千阳县| 新巴尔虎左旗| 台山市| 饶阳县| 九龙县|