Class NegLogLikelihood
- Namespace
- NOpenNLP.Tools.Ml.Maxent.Quasinewton
- Assembly
- NOpenNLP.Tools.dll
Evaluate negative log-likelihood and its gradient from DataIndexer.
public class NegLogLikelihood : IFunction
- Inheritance
-
NegLogLikelihood
- Implements
- Derived
- Inherited Members
Constructors
NegLogLikelihood(IDataIndexer)
public NegLogLikelihood(IDataIndexer indexer)
Parameters
indexerIDataIndexer
Fields
contexts
protected readonly int[][] contexts
Field Value
- int[][]
dimension
protected int dimension
Field Value
expectation
protected double[] expectation
Field Value
- double[]
gradient
protected double[] gradient
Field Value
- double[]
numContexts
protected int numContexts
Field Value
numFeatures
protected int numFeatures
Field Value
numOutcomes
protected int numOutcomes
Field Value
numTimesEventsSeen
protected readonly int[] numTimesEventsSeen
Field Value
- int[]
outcomeList
protected readonly int[] outcomeList
Field Value
- int[]
tempSums
protected double[] tempSums
Field Value
- double[]
values
protected readonly float[][]? values
Field Value
- float[][]
Properties
Dimension
public virtual int Dimension { get; }
Property Value
Methods
GetInitialPoint()
public virtual double[] GetInitialPoint()
Returns
- double[]
GradientAt(double[])
Compute gradient
public virtual double[] GradientAt(double[] x)
Parameters
xdouble[]
Returns
- double[]
IndexOf(int, int)
protected int IndexOf(int outcomeId, int featureId)
Parameters
Returns
ValueAt(double[])
Negative log-likelihood
public virtual double ValueAt(double[] x)
Parameters
xdouble[]