Skip to content

Commit

Permalink
fix: mode of padding
Browse files Browse the repository at this point in the history
  • Loading branch information
kozistr committed Oct 12, 2020
1 parent 1d222f3 commit d6113fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions awesome_gans/wgan/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def __init__(self, config):
def build_discriminator(self) -> tf.keras.Model:
inputs = Input((self.width, self.height, self.n_channels))

x = Conv2D(self.n_feats, 5, 2)(inputs)
x = Conv2D(self.n_feats, kernel_size=5, strides=2, padding='same')(inputs)
x = LeakyReLU(alpha=0.2)(x)

for i in range(3):
x = Conv2D(self.n_feats * (2 ** (i + 1)), 5, 2)(x)
x = Conv2D(self.n_feats * (2 ** (i + 1)), kernel_size=5, strides=2, padding='same')(x)
x = BatchNormalization()(x)
x = LeakyReLU(alpha=0.2)(x)

Expand All @@ -86,11 +86,11 @@ def build_generator(self) -> tf.keras.Model:
x = Reshape((4, 4, 4 * self.z_dims))(x)

for i in range(3):
x = Conv2DTranspose(self.z_dims * 4 // (2 ** i), kernel_size=5, strides=2)(x)
x = Conv2DTranspose(self.z_dims * 4 // (2 ** i), kernel_size=5, strides=2, padding='same')(x)
x = BatchNormalization()(x)
x = ReLU()(x)

x = Conv2DTranspose(self.n_channels, kernel_size=5, strides=1)(x)
x = Conv2DTranspose(self.n_channels, kernel_size=5, strides=1, padding='same')(x)
x = Layer('tanh')(x)

return Model(inputs, x, name='generator')
Expand Down

0 comments on commit d6113fb

Please sign in to comment.