We will now move on to build our deep autoencoder. A deep autoencoder has multiple layers in its encoder and decoder network:
- Let's build an autoencoder:
encoded_dim = 32# input layerinput_img <- layer_input(shape = c(784),name = "input")# encoderencoded = input_img %>% layer_dense(128, activation='relu',name = "encoder_1") %>% layer_dense(64, activation='relu',name = "encoder_2") %>% layer_dense(encoded_dim, activation='relu',name = "encoder_3")# decoderdecoded = encoded %>% layer_dense(64, activation='relu',name = "decoder_1")%>% layer_dense(128, activation='relu',name = "decoder_2")%>% layer_dense(784,activation = 'sigmoid',name = "decoder_3")# autoencoderautoencoder = keras_model(input_img, decoded)summary(autoencoder) ...