Author: tommaso
Date: Sat Jun 22 06:35:37 2013
New Revision: 1495672

URL: http://svn.apache.org/r1495672
Log:
fixed backprop debug message

Modified:
    
labs/yay/trunk/core/src/main/java/org/apache/yay/core/BackPropagationLearningStrategy.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=1495672&r1=1495671&r2=1495672&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
 Sat Jun 22 06:35:37 2013
@@ -18,21 +18,15 @@
  */
 package org.apache.yay.core;
 
-import java.util.Arrays;
-
 import org.apache.commons.math3.linear.Array2DRowRealMatrix;
 import org.apache.commons.math3.linear.ArrayRealVector;
 import org.apache.commons.math3.linear.RealMatrix;
 import org.apache.commons.math3.linear.RealVector;
-import org.apache.yay.CostFunction;
-import org.apache.yay.LearningStrategy;
-import org.apache.yay.NeuralNetwork;
-import org.apache.yay.PredictionStrategy;
-import org.apache.yay.TrainingExample;
-import org.apache.yay.TrainingSet;
-import org.apache.yay.WeightLearningException;
+import org.apache.yay.*;
 import org.apache.yay.core.utils.ConversionUtils;
 
+import java.util.Arrays;
+
 /**
  * Back propagation learning algorithm for neural networks implementation (see
  * <code>http://en.wikipedia.org/wiki/Backpropagation</code>).
@@ -80,7 +74,7 @@ public class BackPropagationLearningStra
         if (newCost > cost) {
           throw new RuntimeException("failed to converge at iteration " + 
iterations + " with alpha " + alpha + " : cost going from " + cost + " to " + 
newCost);
         } else if (cost == newCost || newCost < threshold || iterations > 
MAX_ITERATIONS) {
-          System.out.println("successfully converged with alpha " + alpha + " 
after " + iterations + " iterations with cost " + newCost + " and parameters " 
+ Arrays.toString(hypothesis.getParameters()));
+          System.out.println("successfully converged after " + iterations + " 
iterations (alpha:" + alpha + ",threshold:" + threshold + ") with cost " + 
newCost + " and parameters " + Arrays.toString(hypothesis.getParameters()));
           break;
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to