Author: vkhuc
Date: Mon Jun 16 04:19:03 2014
New Revision: 1602795
URL: http://svn.apache.org/r1602795
Log:
Updated default values for L1Cost, L2Cost, and changed the according tests in
QNPrepAttachTest. Removed the experimental flag from the MAXENT_QN trainer.
Added:
opennlp/trunk/opennlp-tools/lang/ml/MaxentQNTrainerParams.txt
- copied, changed from r1602794,
opennlp/trunk/opennlp-tools/lang/ml/MaxentQnExperimentalTrainerParams.txt
Removed:
opennlp/trunk/opennlp-tools/lang/ml/MaxentQnExperimentalTrainerParams.txt
Modified:
opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/quasinewton/QNTrainer.java
opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/ml/maxent/quasinewton/QNPrepAttachTest.java
Copied: opennlp/trunk/opennlp-tools/lang/ml/MaxentQNTrainerParams.txt (from
r1602794,
opennlp/trunk/opennlp-tools/lang/ml/MaxentQnExperimentalTrainerParams.txt)
URL:
http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/lang/ml/MaxentQNTrainerParams.txt?p2=opennlp/trunk/opennlp-tools/lang/ml/MaxentQNTrainerParams.txt&p1=opennlp/trunk/opennlp-tools/lang/ml/MaxentQnExperimentalTrainerParams.txt&r1=1602794&r2=1602795&rev=1602795&view=diff
==============================================================================
--- opennlp/trunk/opennlp-tools/lang/ml/MaxentQnExperimentalTrainerParams.txt
(original)
+++ opennlp/trunk/opennlp-tools/lang/ml/MaxentQNTrainerParams.txt Mon Jun 16
04:19:03 2014
@@ -15,7 +15,7 @@
# Sample machine learning properties file
-Algorithm=MAXENT_QN_EXPERIMENTAL
+Algorithm=MAXENT_QN
Iterations=100
Cutoff=0
@@ -27,8 +27,8 @@ Cutoff=0
# if L1Cost = 0 and L2Cost > 0, L2 will be used,
# if both paramters are set to be larger than 0, Elastic Net
# (i.e. L1 and L2 combined) will be used.
-L1Cost=0.5
-L2Cost=0.5
+L1Cost=0.1
+L2Cost=0.1
# Number of Hessian updates to store
NumOfUpdates=15
Modified:
opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/quasinewton/QNTrainer.java
URL:
http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/quasinewton/QNTrainer.java?rev=1602795&r1=1602794&r2=1602795&view=diff
==============================================================================
---
opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/quasinewton/QNTrainer.java
(original)
+++
opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/quasinewton/QNTrainer.java
Mon Jun 16 04:19:03 2014
@@ -33,13 +33,13 @@ import opennlp.tools.ml.model.DataIndexe
*/
public class QNTrainer extends AbstractEventTrainer {
- public static final String MAXENT_QN_VALUE = "MAXENT_QN_EXPERIMENTAL";
+ public static final String MAXENT_QN_VALUE = "MAXENT_QN";
public static final String L1COST_PARAM = "L1Cost";
- public static final double L1COST_DEFAULT = 0.5;
+ public static final double L1COST_DEFAULT = 0.1;
public static final String L2COST_PARAM = "L2Cost";
- public static final double L2COST_DEFAULT = 0.5;
+ public static final double L2COST_DEFAULT = 0.1;
// Number of Hessian updates to store
public static final String M_PARAM = "NumOfUpdates";
Modified:
opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/ml/maxent/quasinewton/QNPrepAttachTest.java
URL:
http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/ml/maxent/quasinewton/QNPrepAttachTest.java?rev=1602795&r1=1602794&r2=1602795&view=diff
==============================================================================
---
opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/ml/maxent/quasinewton/QNPrepAttachTest.java
(original)
+++
opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/ml/maxent/quasinewton/QNPrepAttachTest.java
Mon Jun 16 04:19:03 2014
@@ -41,7 +41,7 @@ public class QNPrepAttachTest {
new QNTrainer(true).trainModel(
100, new TwoPassDataIndexer(createTrainingStream(), 1));
- testModel(model, 0.8229759841544937);
+ testModel(model, 0.8155484030700668);
}
@Test
@@ -53,7 +53,7 @@ public class QNPrepAttachTest {
MaxentModel model = TrainerFactory.getEventTrainer(trainParams, null)
.train(createTrainingStream());
- testModel(model, 0.8150532309977717);
+ testModel(model, 0.8115870264917059);
}
@Test