title: Get Decoder for Deep Autoencoder
body: <p>I'm following the tutorial for deep autoencoders in keras <a href="https://blog.keras.io/building-autoencoders-in-keras.html" rel="nofollow noreferrer">here</a>.
  For the simple autoencoder in the beginning there is a <code>decoder</code> defined like this:</p>
  
  <pre><code># retrieve the last layer of the autoencoder model
  decoder_layer = autoencoder.layers[-1]
  
  # create the decoder model
  decoder = Model(encoded_input, decoder_layer(encoded_input))
  </code></pre>
  
  <p>This doesn't work anymore if you have more than one decoder layer. How to do similar if I have three decoder layers?</p>
  
  <pre><code>encoded = Dense(128, activation='relu')(input_img)
  encoded = Dense(64, activation='relu')(encoded)
  encoded = Dense(32, activation='relu')(encoded)
  
  decoded = Dense(64, activation='relu')(encoded)
  decoded = Dense(128, activation='relu')(decoded)
  decoded = Dense(784, activation='sigmoid')(decoded)
  
  autoencoder = Model(input_img, decoded)
  encoder = Model(input_img, encoded)
  </code></pre>
  
  <p>For encoder it does work easily, but how to get a model of the last three layers?</p>