You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@joshua.apache.org by to...@apache.org on 2016/09/28 09:11:13 UTC

incubator-joshua git commit: JOSHUA-291 - minor fixes to AdaGradCore

Repository: incubator-joshua
Updated Branches:
  refs/heads/master f5492d3a0 -> 402b08a87


JOSHUA-291 - minor fixes to AdaGradCore


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/402b08a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/402b08a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/402b08a8

Branch: refs/heads/master
Commit: 402b08a8715b9121ca15b1732310e66a01926e50
Parents: f5492d3
Author: Tommaso Teofili <to...@apache.org>
Authored: Wed Sep 28 11:10:58 2016 +0200
Committer: Tommaso Teofili <to...@apache.org>
Committed: Wed Sep 28 11:10:58 2016 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/joshua/adagrad/AdaGradCore.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/402b08a8/src/main/java/org/apache/joshua/adagrad/AdaGradCore.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/adagrad/AdaGradCore.java b/src/main/java/org/apache/joshua/adagrad/AdaGradCore.java
index 53bb342..c6c7a6e 100755
--- a/src/main/java/org/apache/joshua/adagrad/AdaGradCore.java
+++ b/src/main/java/org/apache/joshua/adagrad/AdaGradCore.java
@@ -56,13 +56,14 @@ import org.slf4j.LoggerFactory;
 
 /**
  * This code was originally written by Yuan Cao, who copied the MERT code to produce this file.
+ *
+ * For more information @see <a href="http://www.jmlr.org/papers/v12/duchi11a.html">AdaGrad</a>.
  */
-
 public class AdaGradCore {
 
   private static final Logger LOG = LoggerFactory.getLogger(AdaGradCore.class);
-  private final static double NegInf = (-1.0 / 0.0);
-  private final static double PosInf = (+1.0 / 0.0);
+  private final static double NegInf = Double.NEGATIVE_INFINITY;
+  private final static double PosInf = Double.POSITIVE_INFINITY;
   private final static double epsilon = 1.0 / 1000000;
   private final static DecimalFormat f4 = new DecimalFormat("###0.0000");