public class MultivariateDiscriminantWithBias extends MultivariateDiscriminant
| Modifier and Type | Field and Description |
|---|---|
protected Vector |
bias
Bias term that gets added the output of the matrix multiplication.
|
| Constructor and Description |
|---|
MultivariateDiscriminantWithBias()
Default constructor.
|
MultivariateDiscriminantWithBias(int numInputs,
int numOutputs)
Creates a new MultivariateDiscriminantWithBias
|
MultivariateDiscriminantWithBias(Matrix discriminant)
Creates a new instance of MultivariateDiscriminantWithBias.
|
MultivariateDiscriminantWithBias(Matrix discriminant,
Vector bias)
Creates a new instance of MultivariateDiscriminantWithBias.
|
| Modifier and Type | Method and Description |
|---|---|
MultivariateDiscriminantWithBias |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
Matrix |
computeParameterGradient(Vector input)
Computes the derivative of the function about the input with respect
to the parameters of the function.
|
void |
convertFromVector(Vector parameters)
Uploads a matrix from a row-stacked vector of parameters.
|
Vector |
convertToVector()
Creates a row-stacked version of the discriminant.
|
Vector |
evaluate(Vector input)
Evaluates the function on the given input and returns the output.
|
Vector |
getBias()
Getter for bias
|
void |
setBias(Vector bias)
Setter for bias
|
computeParameterGradient, differentiate, getDiscriminant, getInputDimensionality, getOutputDimensionality, setDiscriminant, toStringprotected Vector bias
public MultivariateDiscriminantWithBias()
public MultivariateDiscriminantWithBias(int numInputs,
int numOutputs)
numInputs - Number of inputs of the function (number of matrix columns)numOutputs - Number of outputs of the function (number of matrix rows)public MultivariateDiscriminantWithBias(Matrix discriminant)
discriminant - internal matrix to premultiply input vectors by.public MultivariateDiscriminantWithBias(Matrix discriminant, Vector bias)
discriminant - internal matrix to premultiply input vectors by.bias - Bias term that gets added the output of the matrix multiplication.public MultivariateDiscriminantWithBias clone()
AbstractCloneableSerializableObject class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone() to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone() as the basis for your implementation.clone in interface GradientDescendableclone in interface Vectorizableclone in interface VectorizableVectorFunctionclone in interface CloneableSerializableclone in class MultivariateDiscriminantpublic Vector evaluate(Vector input)
Evaluatorpublic Vector getBias()
public void setBias(Vector bias)
bias - Bias term that gets added the output of the matrix multiplication.public Vector convertToVector()
MultivariateDiscriminantconvertToVector in interface VectorizableconvertToVector in class MultivariateDiscriminantpublic void convertFromVector(Vector parameters)
MultivariateDiscriminantconvertFromVector in interface VectorizableconvertFromVector in class MultivariateDiscriminantparameters - row-stacked version of discriminantpublic Matrix computeParameterGradient(Vector input)
GradientDescendablecomputeParameterGradient in interface GradientDescendablecomputeParameterGradient in interface ParameterGradientEvaluator<Vector,Vector,Matrix>computeParameterGradient in class MultivariateDiscriminantinput - Point about which to differentiate w.r.t. the parameters.