def build_generator():
"""
Create a Generator Model with hyperparameters values defined as follows确定超参
"""
z_size = 200
gen_filters = [512, 256, 128, 64, 1]
gen_kernel_sizes = [4, 4, 4, 4, 4]
gen_strides = [1, 2, 2, 2, 2]
gen_input_shape = (1, 1, 1, z_size)
gen_activations = ['relu', 'relu', 'relu', 'relu', 'sigmoid']
gen_convolutional_blocks = 5
#第一个输入层
input_layer = Input(shape=gen_input_shape)
# First 3D transpose convolution(or 3D deconvolution) block添加第一个3d反卷积
a = Deconv3D(filters=gen_filters[0],
kernel_size=gen_kernel_sizes[0],
strides=gen_strides[0])(input_layer)
a = BatchNormalization()(a, training=True)
a = Activation(activation='relu')(a)
# Next 4 3D transpose convolution(or 3D deconvolution) blocks
keras编写结构与GARPHS不一致
最新推荐文章于 2023-07-07 21:54:32 发布
在使用Keras构建神经网络时,发现实际损失(loss)计算与预期不符,本应在激活函数后连接,但在计算图中显示从归一化层开始计算。这个问题可能涉及到模型构建的顺序或图的可视化误解。
摘要由CSDN通过智能技术生成