public class MultivariateDecorrelator extends AbstractCloneableSerializable implements Evaluator<Vectorizable,Vector>, VectorInputEvaluator<Vectorizable,Vector>, VectorOutputEvaluator<Vectorizable,Vector>
Modifier and Type | Class and Description |
---|---|
static class |
MultivariateDecorrelator.DiagonalCovarianceLearner
The
DiagonalCovarianceLearner class implements a BatchLearner
object for a MultivariateDecorrelator . |
static class |
MultivariateDecorrelator.FullCovarianceLearner
The
FullCovarianceLearner class implements a BatchLearner
object for a MultivariateDecorrelator . |
Modifier and Type | Field and Description |
---|---|
protected MultivariateGaussian |
gaussian
The underlying Gaussian.
|
Constructor and Description |
---|
MultivariateDecorrelator()
Creates a new instance of MultivariateDecorrelator with no underlying
Gaussian.
|
MultivariateDecorrelator(MultivariateDecorrelator other)
Copy constructor.
|
MultivariateDecorrelator(MultivariateGaussian gaussian)
Creates a new instance of MultivariateDecorrelator with the given
multivariate Gaussian.
|
MultivariateDecorrelator(Vector mean,
Matrix covariance)
Creates a new instance of MultivariateDecorrelator with the given
mean and variance.
|
Modifier and Type | Method and Description |
---|---|
MultivariateDecorrelator |
clone()
Creates a new copy of this MultivariateDecorrelator.
|
Vector |
evaluate(Vectorizable value)
Normalizes the given double value by subtracting the mean and dividing
by the standard deviation (the square root of the variance).
|
Matrix |
getCovariance()
Gets the covariance.
|
Matrix |
getCovarianceInverseSquareRoot()
Gets the square root of the inverse of the covariance matrix.
|
MultivariateGaussian |
getGaussian()
Gets the underlying multivariate Gaussian.
|
int |
getInputDimensionality()
Gets the expected dimensionality of the input vector to the evaluator,
if it is known.
|
Vector |
getMean()
Gets the mean of the underlying Gaussian.
|
int |
getOutputDimensionality()
Gets the expected dimensionality of the output vector of the evaluator,
if it is known.
|
static MultivariateDecorrelator |
learnDiagonalCovariance(java.util.Collection<? extends Vectorizable> values,
double defaultCovariance)
Learns a normalization based on a mean and covariance where the
covariance matrix is diagonal.
|
static MultivariateDecorrelator |
learnFullCovariance(java.util.Collection<? extends Vectorizable> values,
double defaultCovariance)
Learns a normalization based on a mean and full covariance matrix from
the given data.
|
void |
setGaussian(MultivariateGaussian gaussian)
Sets the underlying multivariate Gaussian.
|
protected MultivariateGaussian gaussian
public MultivariateDecorrelator()
public MultivariateDecorrelator(Vector mean, Matrix covariance)
mean
- The mean.covariance
- The variance.public MultivariateDecorrelator(MultivariateGaussian gaussian)
gaussian
- The multivariate Gaussian to use.public MultivariateDecorrelator(MultivariateDecorrelator other)
other
- MultivariateDecorrelator to copypublic MultivariateDecorrelator clone()
clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public Vector evaluate(Vectorizable value)
evaluate
in interface Evaluator<Vectorizable,Vector>
value
- The value to normalize.public int getInputDimensionality()
VectorInputEvaluator
getInputDimensionality
in interface VectorInputEvaluator<Vectorizable,Vector>
public int getOutputDimensionality()
VectorOutputEvaluator
getOutputDimensionality
in interface VectorOutputEvaluator<Vectorizable,Vector>
public Vector getMean()
public Matrix getCovariance()
public MultivariateGaussian getGaussian()
public void setGaussian(MultivariateGaussian gaussian)
gaussian
- The Gaussian to use.public Matrix getCovarianceInverseSquareRoot()
public static MultivariateDecorrelator learnFullCovariance(java.util.Collection<? extends Vectorizable> values, double defaultCovariance)
values
- The values to learn the decorrelator from.defaultCovariance
- The default value for the covariance. Added to the diagonal of the
covariance matrix to prevent singular values.public static MultivariateDecorrelator learnDiagonalCovariance(java.util.Collection<? extends Vectorizable> values, double defaultCovariance)
values
- The values to use to build the normalizer.defaultCovariance
- The default value for the covariance. Added to the diagonal of the
covariance matrix to prevent singular values.