Class CostFunction
Implements a CostFunction when overridden in a derived class.
Inheritance
System.Object
CostFunction
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace:numl.Math.Functions.Cost
Assembly:numl.dll
Syntax
public abstract class CostFunction : ICostFunction
Properties
View SourceLambda
Gets or sets the weight decay (lambda) parameter.
Declaration
public double Lambda { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Implements
View SourceRegularizer
Gets or sets the regularization method.
Declaration
public IRegularizer Regularizer { get; set; }
Property Value
| Type | Description |
|---|---|
| IRegularizer |
Implements
View SourceX
Gets or sets the input matrix.
Declaration
public Matrix X { get; set; }
Property Value
| Type | Description |
|---|---|
| Matrix |
Implements
View SourceY
Gets or sets the output for each row in X.
Declaration
public Vector Y { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector |
Implements
Methods
View SourceComputeCost(Vector)
Computes the cost of the current theta parameters against the known Y labels.
Declaration
public abstract double ComputeCost(Vector theta)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector | theta |
Returns
| Type | Description |
|---|---|
| System.Double |
Implements
View SourceComputeGradient(Vector)
Computes the current gradient step direction towards the minima.
Declaration
public abstract Vector ComputeGradient(Vector theta)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector | theta |
Returns
| Type | Description |
|---|---|
| Vector |
Implements
View SourceInitialize()
Initialization method for performing custom actions prior to being optimized.
Declaration
public virtual void Initialize()