title: reconstruction latent space with autoencoder
body: <pre><code>import numpy as np
  import numpy.matlib
  import numpy as np
  import pandas as pd
  from keras.layers import Input, Dense
  from keras.models import Model
  from keras.optimizers import RMSprop
  from sklearn.preprocessing import StandardScaler
  from sklearn.preprocessing import MinMaxScaler
  
  sgx=np.random.randn(25200, 100)
  normx = MinMaxScaler().fit(sgx)
  sgxx=normx.fit_transform(sgx)
  
  encoding_dim = 32
  input_img = Input(shape=(100,))
  encoded = Dense(80, activation='relu')(input_img)
  encoded = Dense(64, activation='relu')(encoded)
  encoded = Dense(32, activation='relu')(encoded)
  decoded = Dense(64, activation='relu')(encoded)
  decoded = Dense(90, activation='relu')(decoded)
  decoded = Dense(100, activation='sigmoid')(decoded)
  
  autoencoder = Model(input_img, decoded)
  autoencoder.compile(loss='mean_squared_error', optimizer = RMSprop())
  # this model maps an input to its encoded representation
  encoder = Model(input_img, encoded)
  # create the decoder model
  encoded_input = Input(shape=(encoding_dim,))
  deco = autoencoder.layers[-3](encoded_input)
  deco = autoencoder.layers[-2](deco)
  deco = autoencoder.layers[-1](deco)
  decoder = Model(encoded_input, deco)
  autoencoder.fit(sgxx, sgxx,
                  epochs=100,
                  batch_size=560)
  
  encoded_imgs = encoder.predict(sgx)
  decoded_imgs = decoder.predict(encoded_imgs)
  </code></pre>
  
  <p>in the code above, I reconstructed same initial dimension, can we use AE to reconstruct a lower dimension from initial one, I mean for ex in my case I have 100 dimensions, then after reducing the dimension I would like reconstruct only 30??</p>