train_model function

Trains a VAE or autoencoder model. This acts as a wrapper for keras::fit().