Implemented plot_latents as an external function in util