changed my script to do MPF learning on an RBM into a function - returns time slices of learning as well as a model struct which can be used in other code