Using variational autoencoders to learn variations in data