add a batch version of autoencoder