org.openimaj.math.matrix.algorithm.whitening

Class PCAWhitening

• Direct Known Subclasses:
ZCAWhitening

@Reference(type=Book,
author={"Hyvrinen, Aapo","Hurri, Jarmo","Hoyer, Patrick O."},
title="Natural Image Statistics: A Probabilistic Approach to Early Computational Vision.",
year="2009",
edition="1st",
publisher="Springer Publishing Company, Incorporated",
customData={"isbn","1848824904, 9781848824904"})
public class PCAWhitening
extends WhiteningTransform
Whitening based on PCA. The PCA basis is used to rotate the data, and then the data is normalised by the variances such that it has unit variance along all principal axes.

Optionally, you can also reduce the dimensionality of the data during the whitening process (by throwing away components with small eignevalues).

Author:
Jonathon Hare (jsh2@ecs.soton.ac.uk)
• Field Summary

Fields
Modifier and Type Field and Description
protected double eps
protected int ndims
protected Normaliser ns
protected Jama.Matrix transform
• Constructor Summary

Constructors
Constructor and Description
PCAWhitening(double eps, Normaliser ns)
Construct with the given variance regularization parameter and data normalisation strategy.
PCAWhitening(double eps, Normaliser ns, int ndims)
Construct with the given variance regularization parameter, data normalisation strategy and target dimensionality.
• Method Summary

All Methods
Modifier and Type Method and Description
Jama.Matrix getTransform()
Get the underlying whitening transform matrix.
void train(double[][] data)
Train the whitening transform with the given features.
double[] whiten(double[] vector)
Apply the whitening transform to the given vector.

whiten
• Field Detail

• eps

protected double eps
• transform

protected Jama.Matrix transform
• ndims

protected int ndims
• Constructor Detail

• PCAWhitening

public PCAWhitening(double eps,
Normaliser ns)
Construct with the given variance regularization parameter and data normalisation strategy.
Parameters:
eps - the variance normalisation regularizer (each principle dimension is divided by sqrt(lamba + eps), where lamba is the corresponding eigenvalue).
ns - the normalisation to apply to each input data vector prior to training the transform or applying the actual whitening.
• PCAWhitening

public PCAWhitening(double eps,
Normaliser ns,
int ndims)
Construct with the given variance regularization parameter, data normalisation strategy and target dimensionality.
Parameters:
eps - the variance normalisation regularizer (each principle dimension is divided by sqrt(lamba + eps), where lamba is the corresponding eigenvalue).
ns - the normalisation to apply to each input data vector prior to training the transform or applying the actual whitening.
ndims - the number of output dimensions for the whitened data
• Method Detail

• whiten

public double[] whiten(double[] vector)
Description copied from class: WhiteningTransform
Apply the whitening transform to the given vector.
Specified by:
whiten in class WhiteningTransform
Parameters:
vector - the vector
Returns:
the whitened vector
• train

public void train(double[][] data)
Description copied from class: WhiteningTransform
Train the whitening transform with the given features.
Specified by:
train in class WhiteningTransform
Parameters:
data - the data (one feature per row)
• getTransform

public Jama.Matrix getTransform()
Get the underlying whitening transform matrix.
Returns:
the matrix