public class DifferentiableGeneralizedLinearModel extends GeneralizedLinearModel implements GradientDescendable, DifferentiableVectorFunction
Constructor and Description |
---|
DifferentiableGeneralizedLinearModel()
Default Constructor.
|
DifferentiableGeneralizedLinearModel(DifferentiableGeneralizedLinearModel other)
Creates a new instance of DifferentiableGeneralizedLinearModel
|
DifferentiableGeneralizedLinearModel(int numInputs,
int numOutputs,
DifferentiableUnivariateScalarFunction scalarFunction)
Creates a new instance of GeneralizedLinearModel
|
DifferentiableGeneralizedLinearModel(MultivariateDiscriminant matrixMultiply,
DifferentiableUnivariateScalarFunction scalarSquashingFunction)
Creates a new instance of DifferentiableGeneralizedLinearModel
|
DifferentiableGeneralizedLinearModel(MultivariateDiscriminant matrixMultiply,
DifferentiableVectorFunction squashingFunction)
Creates a new instance of DifferentiableGeneralizedLinearModel
|
Modifier and Type | Method and Description |
---|---|
DifferentiableGeneralizedLinearModel |
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.
|
Matrix |
differentiate(Vector input)
Differentiate the VectorFunction at
input and return
the Jacobian |
DifferentiableVectorFunction |
getSquashingFunction()
Getter for squashingFunction
|
convertFromVector, convertToVector, evaluate, getDiscriminant, getInputDimensionality, getOutputDimensionality, setDiscriminant, setSquashingFunction, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
convertFromVector, convertToVector
public DifferentiableGeneralizedLinearModel()
public DifferentiableGeneralizedLinearModel(int numInputs, int numOutputs, DifferentiableUnivariateScalarFunction scalarFunction)
numInputs
- Number of inputs of the function (number of matrix columns)numOutputs
- Number of outputs of the function (number of matrix rows)scalarFunction
- Function to apply to each outputpublic DifferentiableGeneralizedLinearModel(MultivariateDiscriminant matrixMultiply, DifferentiableVectorFunction squashingFunction)
matrixMultiply
- GradientDescendable that multiplies an input by the internal matrixsquashingFunction
- VectorFunction that is applied to the output of the matrix multiplypublic DifferentiableGeneralizedLinearModel(MultivariateDiscriminant matrixMultiply, DifferentiableUnivariateScalarFunction scalarSquashingFunction)
matrixMultiply
- GradientDescendable that multiplies an input by the internal matrixscalarSquashingFunction
- scalar function that is applied to the output of the matrix multiplypublic DifferentiableGeneralizedLinearModel(DifferentiableGeneralizedLinearModel other)
other
- DifferentiableGeneralizedLinearModel to copypublic DifferentiableVectorFunction getSquashingFunction()
GeneralizedLinearModel
getSquashingFunction
in class GeneralizedLinearModel
public Matrix computeParameterGradient(Vector input)
GradientDescendable
computeParameterGradient
in interface GradientDescendable
computeParameterGradient
in interface ParameterGradientEvaluator<Vector,Vector,Matrix>
input
- Point about which to differentiate w.r.t. the parameters.public DifferentiableGeneralizedLinearModel clone()
AbstractCloneableSerializable
Object
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 GradientDescendable
clone
in interface Vectorizable
clone
in interface VectorizableVectorFunction
clone
in interface CloneableSerializable
clone
in class GeneralizedLinearModel
public Matrix differentiate(Vector input)
DifferentiableVectorFunction
input
and return
the Jacobiandifferentiate
in interface DifferentiableEvaluator<Vector,Vector,Matrix>
differentiate
in interface DifferentiableVectorFunction
input
- Vector input to the VectorFunction, about which to evaluate
the VectorFunctioninput