Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Created February 4, 2020 11:19
Show Gist options
  • Save prateekjoshi565/5a7b7aadabde20cf2a97bc0c554fdd5e to your computer and use it in GitHub Desktop.
Save prateekjoshi565/5a7b7aadabde20cf2a97bc0c554fdd5e to your computer and use it in GitHub Desktop.
Input_img = Input(shape=(80, 80, 3))
#encoding architecture
x1 = Conv2D(256, (3, 3), activation='relu', padding='same')(Input_img)
x2 = Conv2D(128, (3, 3), activation='relu', padding='same')(x1)
x2 = MaxPool2D( (2, 2))(x2)
encoded = Conv2D(64, (3, 3), activation='relu', padding='same')(x2)
# decoding architecture
x3 = Conv2D(64, (3, 3), activation='relu', padding='same')(encoded)
x3 = UpSampling2D((2, 2))(x3)
x2 = Conv2D(128, (3, 3), activation='relu', padding='same')(x3)
x1 = Conv2D(256, (3, 3), activation='relu', padding='same')(x2)
decoded = Conv2D(3, (3, 3), padding='same')(x1)
autoencoder = Model(Input_img, decoded)
autoencoder.compile(optimizer='adam', loss='mse')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment