Robust Variational Autoencoder Code