def generator_model(noise_dim=100, aux_dim=47, model_name="generator"):
# Merge noise and auxilary inputs
gen_input = Input(shape=(noise_dim,), name="noise_input")
aux_input = Input(shape=(aux_dim,), name="auxilary_input")
x = merge([gen_input, aux_input], mode="concat", concat_axis=-1)
# Dense Layer 1
x = Dense(1024)(x)
x = BatchNormalization()(x)
x = LeakyReLU(0.2)(x)
# Dense Layer 2
x = Dense(1024)(x)
x = BatchNormalization()(x)
x = LeakyReLU(0.2)(x)
# Dense Layer 3
x = Dense(1024)(x)
x = BatchNormalization()(x)
x = LeakyReLU(0.2)(x)
# Dense Layer 4
x = Dense(400)(x)
x = BatchNormalization()(x)
x = Activation("tanh")(x)
generator_model = Model(input=[gen_input, aux_input], output=[x], name=model_name)
return generator_model
评论列表
文章目录