Split off the training code inside a function that can be reused.
Split off the training code inside a function that can be reused.

This way it's easier to have multiple models to train.

nouiz/summerschool2015,mila-udem/summerschool2015,wangzexian/summrerschool2015