labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1706761 - in /labs/yay/trunk/core/src: main/java/org/apache/yay/core/BackPropagationLearningStrategy.java test/java/org/apache/yay/core/NeuralNetworkIntegrationTest.java
Date Mon, 05 Oct 2015 08:31:34 GMT
Author: tommaso
Date: Mon Oct  5 08:31:34 2015
New Revision: 1706761

URL: http://svn.apache.org/viewvc?rev=1706761&view=rev
Log:
fixed bug in backprop not correctly updating weights

Modified:
    labs/yay/trunk/core/src/main/java/org/apache/yay/core/BackPropagationLearningStrategy.java
    labs/yay/trunk/core/src/test/java/org/apache/yay/core/NeuralNetworkIntegrationTest.java

Modified: labs/yay/trunk/core/src/main/java/org/apache/yay/core/BackPropagationLearningStrategy.java
URL: http://svn.apache.org/viewvc/labs/yay/trunk/core/src/main/java/org/apache/yay/core/BackPropagationLearningStrategy.java?rev=1706761&r1=1706760&r2=1706761&view=diff
==============================================================================
--- labs/yay/trunk/core/src/main/java/org/apache/yay/core/BackPropagationLearningStrategy.java
(original)
+++ labs/yay/trunk/core/src/main/java/org/apache/yay/core/BackPropagationLearningStrategy.java
Mon Oct  5 08:31:34 2015
@@ -118,7 +118,7 @@ public class BackPropagationLearningStra
         RealMatrix[] derivatives = derivativeUpdateFunction.updateParameters(weightsMatrixSet,
samples);
 
         // calculate the updated parameters
-        updatedWeights = updateWeights(weightsMatrixSet, derivatives, alpha);
+        updatedWeights = updateWeights(updatedWeights, derivatives, alpha);
 
         // update parameters in the hypothesis
         hypothesis.setParameters(updatedWeights);

Modified: labs/yay/trunk/core/src/test/java/org/apache/yay/core/NeuralNetworkIntegrationTest.java
URL: http://svn.apache.org/viewvc/labs/yay/trunk/core/src/test/java/org/apache/yay/core/NeuralNetworkIntegrationTest.java?rev=1706761&r1=1706760&r2=1706761&view=diff
==============================================================================
--- labs/yay/trunk/core/src/test/java/org/apache/yay/core/NeuralNetworkIntegrationTest.java
(original)
+++ labs/yay/trunk/core/src/test/java/org/apache/yay/core/NeuralNetworkIntegrationTest.java
Mon Oct  5 08:31:34 2015
@@ -186,7 +186,7 @@ public class NeuralNetworkIntegrationTes
           if (c == 0) {
             d[0][c] = 1d;
           } else {
-            d[0][c] = r.nextDouble();
+            d[0][c] = r.nextInt(100) / 101d;;
           }
         } else {
           d[0][c] = 0;
@@ -199,7 +199,7 @@ public class NeuralNetworkIntegrationTes
           if (j == 0) {
             val = 1d;
           } else {
-            val = r.nextDouble();
+            val = r.nextInt(100) / 101d;;
           }
           d[k][j] = val;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message