Skip to content

Instantly share code, notes, and snippets.

@sgl0v
Last active June 2, 2021 19:24
Show Gist options
  • Save sgl0v/8e1a8cc650c8376ed15cd985e9677023 to your computer and use it in GitHub Desktop.
Save sgl0v/8e1a8cc650c8376ed15cd985e9677023 to your computer and use it in GitHub Desktop.
def create_model():
model = Sequential()
model.add(InputLayer(input_shape=(400, 400, 1)))
model.add(Conv2D(8, (3, 3), activation='relu', padding='same', strides=2))
model.add(Conv2D(8, (3, 3), activation='relu', padding='same'))
model.add(Conv2D(16, (3, 3), activation='relu', padding='same'))
model.add(Conv2D(16, (3, 3), activation='relu', padding='same', strides=2))
model.add(Conv2D(32, (3, 3), activation='relu', padding='same'))
model.add(Conv2D(32, (3, 3), activation='relu', padding='same', strides=2))
model.add(UpSampling2D((2, 2)))
model.add(Conv2D(32, (3, 3), activation='relu', padding='same'))
model.add(UpSampling2D((2, 2)))
model.add(Conv2D(16, (3, 3), activation='relu', padding='same'))
model.add(UpSampling2D((2, 2)))
model.add(Conv2D(2, (3, 3), activation='tanh', padding='same'))
model.compile(optimizer='rmsprop', loss='mse')
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment