cleanup and rearrangement
added parrallel latetent example generation to speed up training.