Updated code to work with latest Pylearn2.
Added support for saving percepts.