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

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.

主站蜘蛛池模板: 泸水县| 衢州市| 宝清县| 南木林县| 泸溪县| 陇川县| 麻阳| 铅山县| 乐清市| 博罗县| 马关县| 大关县| 中宁县| 株洲市| 永顺县| 中牟县| 鹤山市| 余江县| 莲花县| 桓台县| 同江市| 板桥市| 昌宁县| 三河市| 中西区| 江华| 营山县| 汝南县| 南雄市| 凤山县| 黄浦区| 阿拉善右旗| 澎湖县| 疏附县| 阳东县| 巴彦淖尔市| 南宫市| 松江区| 密山市| 九台市| 巴林右旗|