Class QNTrainer
- Namespace
- NOpenNLP.Tools.Ml.Maxent.Quasinewton
- Assembly
- NOpenNLP.Tools.dll
Maxent model trainer using L-BFGS algorithm.
public class QNTrainer : AbstractEventTrainer, IEventTrainer
- Inheritance
-
QNTrainer
- Implements
- Inherited Members
Constructors
QNTrainer()
public QNTrainer()
QNTrainer(TrainingParameters)
public QNTrainer(TrainingParameters parameters)
Parameters
parametersTrainingParameters
QNTrainer(bool)
public QNTrainer(bool printMessages)
Parameters
printMessagesbool
QNTrainer(int)
public QNTrainer(int m)
Parameters
mint
QNTrainer(int, bool)
public QNTrainer(int m, bool verbose)
Parameters
QNTrainer(int, int, bool)
public QNTrainer(int m, int maxFctEval, bool printMessages)
Parameters
Fields
L1COST_DEFAULT
public const double L1COST_DEFAULT = 0.1
Field Value
L1COST_PARAM
public const string L1COST_PARAM = "L1Cost"
Field Value
L2COST_DEFAULT
public const double L2COST_DEFAULT = 0.1
Field Value
L2COST_PARAM
public const string L2COST_PARAM = "L2Cost"
Field Value
MAXENT_QN_VALUE
public const string MAXENT_QN_VALUE = "MAXENT_QN"
Field Value
MAX_FCT_EVAL_DEFAULT
public const int MAX_FCT_EVAL_DEFAULT = 30000
Field Value
MAX_FCT_EVAL_PARAM
public const string MAX_FCT_EVAL_PARAM = "MaxFctEval"
Field Value
M_DEFAULT
public const int M_DEFAULT = 15
Field Value
M_PARAM
public const string M_PARAM = "NumOfUpdates"
Field Value
THREADS_DEFAULT
public const int THREADS_DEFAULT = 1
Field Value
THREADS_PARAM
public const string THREADS_PARAM = "Threads"
Field Value
Properties
IsSortAndMerge
Whether the data indexer should sort and merge the indexed events.
public override bool IsSortAndMerge { get; }
Property Value
Methods
DoTrain(IDataIndexer)
Trains a model from the given, already indexed, training data.
public override IMaxentModel DoTrain(IDataIndexer indexer)
Parameters
indexerIDataIndexer
Returns
Init(TrainingParameters, IDictionary<string, string>?)
Initializes this trainer with the given parameters and report map.
public override void Init(TrainingParameters trainingParameters, IDictionary<string, string>? reportMap)
Parameters
trainingParametersTrainingParametersreportMapIDictionary<string, string>
TrainModel(int, IDataIndexer)
public QNModel TrainModel(int iterations, IDataIndexer indexer)
Parameters
iterationsintindexerIDataIndexer
Returns
Validate()
Checks the parameters. If a subclass overrides this, it should call the base implementation.
public override void Validate()
Exceptions
- ArgumentException
Thrown if a parameter is not valid.