You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by to...@apache.org on 2012/05/06 22:33:46 UTC

svn commit: r1334762 - in /labs/yay/trunk/core/src/main/java/org/apache/yay: LearningStrategy.java NeuralNetworkFactory.java WeightLearningException.java

Author: tommaso
Date: Sun May  6 20:33:46 2012
New Revision: 1334762

URL: http://svn.apache.org/viewvc?rev=1334762&view=rev
Log:
moved out WeightLearningException from LearningStrategy

Added:
    labs/yay/trunk/core/src/main/java/org/apache/yay/WeightLearningException.java
Modified:
    labs/yay/trunk/core/src/main/java/org/apache/yay/LearningStrategy.java
    labs/yay/trunk/core/src/main/java/org/apache/yay/NeuralNetworkFactory.java

Modified: labs/yay/trunk/core/src/main/java/org/apache/yay/LearningStrategy.java
URL: http://svn.apache.org/viewvc/labs/yay/trunk/core/src/main/java/org/apache/yay/LearningStrategy.java?rev=1334762&r1=1334761&r2=1334762&view=diff
==============================================================================
--- labs/yay/trunk/core/src/main/java/org/apache/yay/LearningStrategy.java (original)
+++ labs/yay/trunk/core/src/main/java/org/apache/yay/LearningStrategy.java Sun May  6 20:33:46 2012
@@ -22,16 +22,11 @@ import java.util.Collection;
 import java.util.Set;
 
 /**
- *
+ * A {@link LearningStrategy}<F,O> defines a learning algorithm to learn the weights of the neural network's layer
  */
 public interface LearningStrategy<F, O> {
 
   public Set<WeightsMatrix> learnWeights(Set<WeightsMatrix> weightsMatrixSet, Collection<TrainingExample<F, O>>
           trainingExamples) throws WeightLearningException;
 
-  class WeightLearningException extends Exception {
-    public WeightLearningException(Throwable throwable) {
-      super(throwable);
-    }
-  }
 }

Modified: labs/yay/trunk/core/src/main/java/org/apache/yay/NeuralNetworkFactory.java
URL: http://svn.apache.org/viewvc/labs/yay/trunk/core/src/main/java/org/apache/yay/NeuralNetworkFactory.java?rev=1334762&r1=1334761&r2=1334762&view=diff
==============================================================================
--- labs/yay/trunk/core/src/main/java/org/apache/yay/NeuralNetworkFactory.java (original)
+++ labs/yay/trunk/core/src/main/java/org/apache/yay/NeuralNetworkFactory.java Sun May  6 20:33:46 2012
@@ -49,7 +49,7 @@ public class NeuralNetworkFactory {
       public void learn(TrainingExample<Double, Double>... samples) throws LearningException {
         try {
           updatedWeightsMatrixSet = learningStrategy.learnWeights(weightsMatrixSet, trainingExamples);
-        } catch (Exception e) {
+        } catch (WeightLearningException e) {
           throw new LearningException(e);
         }
       }

Added: labs/yay/trunk/core/src/main/java/org/apache/yay/WeightLearningException.java
URL: http://svn.apache.org/viewvc/labs/yay/trunk/core/src/main/java/org/apache/yay/WeightLearningException.java?rev=1334762&view=auto
==============================================================================
--- labs/yay/trunk/core/src/main/java/org/apache/yay/WeightLearningException.java (added)
+++ labs/yay/trunk/core/src/main/java/org/apache/yay/WeightLearningException.java Sun May  6 20:33:46 2012
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.yay;
+
+/**
+ * Exception raised when something goes wrong during the learning algorithm execution
+ */
+public class WeightLearningException extends Exception {
+  public WeightLearningException(Throwable throwable) {
+    super(throwable);
+  }
+}



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