Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created December 16, 2018 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NMZivkovic/f93dfdbaf0134aef615cb72d55745c1e to your computer and use it in GitHub Desktop.
Save NMZivkovic/f93dfdbaf0134aef615cb72d55745c1e to your computer and use it in GitHub Desktop.
def _build_generator_model(self):
generator_input = Input(shape=(self.generator_input_dim,))
generator_seqence = Sequential(
[Dense(256, input_dim=self.generator_input_dim),
LeakyReLU(alpha=0.2),
BatchNormalization(momentum=0.8),
Dense(512),
LeakyReLU(alpha=0.2),
BatchNormalization(momentum=0.8),
Dense(1024),
LeakyReLU(alpha=0.2),
BatchNormalization(momentum=0.8),
Dense(np.prod(self.img_shape), activation='tanh'),
Reshape(self.img_shape)])
generator_output_tensor = generator_seqence(generator_input)
self.generator_model = Model(generator_input, generator_output_tensor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment