Added a simple train extension to save weights