I am getting confused in the testing dataset of a VAE. After training the VAE, what should be the testing data-set of the VAE?

I understand that during testing the VAE only has the decoder part. Hence, we need to give inputs from the latent space. But what input shall be there? It can't be any random set of numbers, right?

Thanks for the help


1 Answer 1


When building your VAE model, you must use the common training/testing datasets to train/evaluate your VAE model performances. That means you validate your model using the testing dataset on both the encoder and the decoder parts.

I understand that during testing the VAE only has the decoder part.

You're probably refering to one common use of VAE, that is to generate new samples using only the decoder part, but it comes after building a model.

I hope it helps.

  • $\begingroup$ Hi, thanks for the answer. Can you also share the difference between training and validation set for the VAE model? I understand that the testing would be done to check how well the model is predicting on unseen data. e.g. a VAE model trained to output MNIST digits, will be tested by giving an input such as a certain image of 5 (which it has not seen during training) and expected to give us an approximate looking 5. But what will validation set do? $\endgroup$ Feb 20 at 14:42
  • $\begingroup$ Validation is used to tune the VAE (architecture, type of init, number of training epochs, ...). A typical example is the use of EarlyStopping. The training on the train set is stopped on condition on validation set. $\endgroup$
    – etiennedm
    Feb 21 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.