vectorized autoencoder working