lisa-lab/pylearn — pull request #82 by dwf (2012-03-20 20:10:10+00:00)
Title: Add stateful logic to RemoveMean and Standardize.

Often you'd like to replicate the exact preprocessing on the training
set on the validation or test set, including the specific mean/standard
deviation center/scaling. In other cases, you might be training an
autoencoder with a domain specific cost function, which requires the
data be scaled-back and the mean re-added in order to sensibly evaluate
the cost. Both of these call for preprocessors that remember the
mean and standard deviation "parameters", and the ability to apply the
preprocessor without re-fitting those parameters.

This adds additional logic that makes use of the (currently ignored)
can_fit parameter to implement this behaviour, and stores the "fitted"
parameters as instance attributes. The API for retrieving these
quantities is forthcoming.

Separately, this prefixes saved instantiation parameters with a _ to
mark them private-by-convention.

cc/@gdesjardins