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

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.

主站蜘蛛池模板: 玉溪市| 北宁市| 房产| 明水县| 潜山县| 库伦旗| 宣威市| 阜南县| 鄂温| 长阳| 获嘉县| 临猗县| 外汇| 绥化市| 大化| 包头市| 松滋市| 平山县| 兴业县| 贺兰县| 大姚县| 青浦区| 贵港市| 涞源县| 建宁县| 鄄城县| 神农架林区| 海林市| 银川市| 呈贡县| 贵州省| 神木县| 成安县| 安泽县| 琼中| 高台县| 景泰县| 乳源| 宜州市| 休宁县| 于田县|