Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. input_layer = Input(shape=(258, 540, 1))
  2.  
  3. # encoder
  4. encoder = Conv2D(64, (3, 3), activation='relu', padding='same')(input_layer)
  5. encoder = MaxPooling2D((2, 2), padding='same')(encoder)
  6.  
  7. # decoder
  8. decoder = Conv2D(64, (3, 3), activation='relu', padding='same')(encoder)
  9. decoder = UpSampling2D((2, 2))(decoder)
  10. output_layer = Conv2D(1, (3, 3), activation='sigmoid', padding='same')(decoder)
  11.  
  12. ae = Model(input_layer, output_layer)
  13.  
  14. ae.compile(loss='mse', optimizer=Adam(lr=0.001))
  15.  
  16. batch_size = 16
  17. epochs = 200
  18.  
  19. early_stopping = EarlyStopping(monitor='val_loss',min_delta=0,patience=5,verbose=1, mode='auto')
  20. history = ae.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, validation_data=(x_val, y_val), callbacks=[early_stopping])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement