|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopennlp.perceptron.PerceptronTrainer
public class PerceptronTrainer
Trains models using the perceptron algorithm. Each outcome is represented as a binary perceptron classifier. This supports standard (integer) weighting as well average weighting as described in: Discriminative Training Methods for Hidden Markov Models: Theory and Experiments with the Perceptron Algorithm. Michael Collins, EMNLP 2002.
Field Summary | |
---|---|
static double |
TOLERANCE_DEFAULT
|
Constructor Summary | |
---|---|
PerceptronTrainer()
|
Method Summary | |
---|---|
void |
setSkippedAveraging(boolean averaging)
Enables skipped averaging, this flag changes the standard averaging to special averaging instead. |
void |
setStepSizeDecrease(double decrease)
Enables and sets step size decrease. |
void |
setTolerance(double tolerance)
Specifies the tolerance. |
AbstractModel |
trainModel(int iterations,
DataIndexer di,
int cutoff)
|
AbstractModel |
trainModel(int iterations,
DataIndexer di,
int cutoff,
boolean useAverage)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double TOLERANCE_DEFAULT
Constructor Detail |
---|
public PerceptronTrainer()
Method Detail |
---|
public void setTolerance(double tolerance)
tolerance
- public void setStepSizeDecrease(double decrease)
decrease
- - step size decrease in percentpublic void setSkippedAveraging(boolean averaging)
If we are doing averaging, and the current iteration is one of the first 20 or it is a perfect square, then updated the summed parameters.
The reason we don't take all of them is that the parameters change less toward the end of training, so they drown out the contributions of the more volatile early iterations. The use of perfect squares allows us to sample from successively farther apart iterations.
averaging
- public AbstractModel trainModel(int iterations, DataIndexer di, int cutoff)
public AbstractModel trainModel(int iterations, DataIndexer di, int cutoff, boolean useAverage)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |