Created
July 25, 2019 05:14
-
-
Save MortisHuang/9b4c73c760d788c0a57b372a1640590c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generator(): | |
""" Declare generator """ | |
model = Sequential() | |
model.add(Dense(256, input_shape=(10,))) | |
model.add(LeakyReLU(alpha=0.2)) # 使用 LeakyReLU 激活函數 | |
model.add(BatchNormalization(momentum=0.8)) # 使用 BatchNormalization 優化 | |
model.add(Dense(512)) | |
model.add(LeakyReLU(alpha=0.2)) | |
model.add(BatchNormalization(momentum=0.8)) | |
model.add(Dense(1024)) | |
model.add(LeakyReLU(alpha=0.2)) | |
model.add(BatchNormalization(momentum=0.8)) | |
model.add(Dense(width * height * channels, activation='tanh')) | |
model.add(Reshape((width, height, channels))) | |
model.summary() | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment