Data Preprocessing

tflearn.data_preprocessing.DataPreprocessing (name='DataPreprocessing')

Base class for applying common real-time data preprocessing.

This class is meant to be used as an argument of input_data. When training a model, the defined pre-processing methods will be applied at both training and testing time. Note that DataAugmentation is similar to DataPreprocessing, but only applies at training time.

Arguments

  • None.

Methods

add_custom_preprocessing (func)

Apply any custom pre-processing function to the .

Arguments
  • func: a Function that take a numpy array as input and returns a numpy array.
Returns

Nothing.

add_featurewise_stdnorm (std=None)

Scale each sample by the specified standard deviation. If no std specified, std is evaluated over all samples data.

Arguments
  • std: float (optional). Provides a custom standard derivation. If none provided, it will be automatically caluclated based on the training dataset. Default: None.
Returns

Nothing.

add_featurewise_zero_center (mean=None)

Zero center every sample with specified mean. If not specified, the mean is evaluated over all samples.

Arguments
  • mean: float (optional). Provides a custom mean. If none provided, it will be automatically caluclated based on the training dataset. Default: None.
Returns

Nothing.

add_samplewise_stdnorm (self)

Scale each sample with its standard deviation.

Returns

Nothing.

add_samplewise_zero_center (self)

Zero center each sample by subtracting it by its mean.

Returns

Nothing.

add_zca_whitening (pc=None)

Apply ZCA Whitening to data.

Arguments
  • pc: array (optional). Use the provided pre-computed principal component instead of computing it.
Returns

Nothing.