Author: tommaso Date: Sat Mar 15 15:03:04 2014 New Revision: 1577874 URL: http://svn.apache.org/r1577874 Log: added missing javadoc to yay-api
Removed: labs/yay/trunk/api/src/main/java/org/apache/yay/ErrorFunction.java Modified: labs/yay/trunk/api/src/main/java/org/apache/yay/ActivationFunction.java labs/yay/trunk/api/src/main/java/org/apache/yay/CostFunction.java labs/yay/trunk/api/src/main/java/org/apache/yay/Hypothesis.java labs/yay/trunk/api/src/main/java/org/apache/yay/Input.java labs/yay/trunk/api/src/main/java/org/apache/yay/Layer.java labs/yay/trunk/api/src/main/java/org/apache/yay/LearningStrategy.java labs/yay/trunk/api/src/main/java/org/apache/yay/PredictionStrategy.java labs/yay/trunk/api/src/main/java/org/apache/yay/SelectionFunction.java labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingExample.java Modified: labs/yay/trunk/api/src/main/java/org/apache/yay/ActivationFunction.java URL: http://svn.apache.org/viewvc/labs/yay/trunk/api/src/main/java/org/apache/yay/ActivationFunction.java?rev=1577874&r1=1577873&r2=1577874&view=diff ============================================================================== --- labs/yay/trunk/api/src/main/java/org/apache/yay/ActivationFunction.java (original) +++ labs/yay/trunk/api/src/main/java/org/apache/yay/ActivationFunction.java Sat Mar 15 15:03:04 2014 @@ -22,12 +22,18 @@ package org.apache.yay; * An activation function AF : S -> S receives a signal and generates a new signal. * An activation function AF has horizontal asymptotes at 0 and 1 and a non * decreasing first derivative AF' with AF and AF' both being computable. - * + * <p/> * These are usually used in {@link Neuron}s in order to propagate the "signal" * throughout the whole {@link NeuralNetwork}. */ public interface ActivationFunction<T> { - public T apply(T signal); + /** + * Apply this <code>ActivationFunction</code> to the given signal, generating a new signal + * + * @param signal the input signal + * @return the output signal generated + */ + T apply(T signal); } Modified: labs/yay/trunk/api/src/main/java/org/apache/yay/CostFunction.java URL: http://svn.apache.org/viewvc/labs/yay/trunk/api/src/main/java/org/apache/yay/CostFunction.java?rev=1577874&r1=1577873&r2=1577874&view=diff ============================================================================== --- labs/yay/trunk/api/src/main/java/org/apache/yay/CostFunction.java (original) +++ labs/yay/trunk/api/src/main/java/org/apache/yay/CostFunction.java Sat Mar 15 15:03:04 2014 @@ -26,10 +26,27 @@ import java.util.Collection; */ public interface CostFunction<T, I, O> { - public Double calculateAggregatedCost(TrainingSet<I, O> trainingExamples, - Hypothesis<T, I, O> hypothesis) throws Exception; - public Double calculateCost(TrainingExample<I, O> trainingExample, - Hypothesis<T, I, O> hypothesis) throws Exception; + /** + * Calculate the cost of a {@link org.apache.yay.TrainingSet} for a given {@link org.apache.yay.Hypothesis} + * + * @param trainingExamples the training set + * @param hypothesis the hypothesis + * @return a <code>Double</code> cost + * @throws Exception if any error occurs during the cost calculation + */ + Double calculateAggregatedCost(TrainingSet<I, O> trainingExamples, + Hypothesis<T, I, O> hypothesis) throws Exception; + + /** + * Calculate the cost of a single {@link org.apache.yay.TrainingExample} for a given {@link org.apache.yay.Hypothesis} + * + * @param trainingExample the training example + * @param hypothesis the hypothesis + * @return a <code>Double</code> cost + * @throws Exception if any error occurs during the cost calculation + */ + Double calculateCost(TrainingExample<I, O> trainingExample, + Hypothesis<T, I, O> hypothesis) throws Exception; } Modified: labs/yay/trunk/api/src/main/java/org/apache/yay/Hypothesis.java URL: http://svn.apache.org/viewvc/labs/yay/trunk/api/src/main/java/org/apache/yay/Hypothesis.java?rev=1577874&r1=1577873&r2=1577874&view=diff ============================================================================== --- labs/yay/trunk/api/src/main/java/org/apache/yay/Hypothesis.java (original) +++ labs/yay/trunk/api/src/main/java/org/apache/yay/Hypothesis.java Sat Mar 15 15:03:04 2014 @@ -24,12 +24,35 @@ package org.apache.yay; */ public interface Hypothesis<T, I, O> { - public void setParameters(T... parameters); + /** + * Set this <code>Hypothesis</code>'s parameters + * + * @param parameters an array of parameters + */ + void setParameters(T... parameters); + /** + * Get this <code>Hypothesis</code>'s parameters + * + * @return the parameters array + */ T[] getParameters(); - public O predict(Input<I> input) throws PredictionException; + /** + * Predict the output for a given input + * + * @param input the input to evaluate + * @return the predicted output + * @throws PredictionException if any error occurs during the prediction phase + */ + O predict(Input<I> input) throws PredictionException; - public void learn(TrainingSet<I, O> trainingExamples) throws LearningException; + /** + * Let this <code>Hypothesis</code> learn by experience, in the form of a {@link org.apache.yay.TrainingSet} + * + * @param trainingExamples the learning {@link org.apache.yay.TrainingSet} + * @throws LearningException if any error occurs during the learning phase + */ + void learn(TrainingSet<I, O> trainingExamples) throws LearningException; } Modified: labs/yay/trunk/api/src/main/java/org/apache/yay/Input.java URL: http://svn.apache.org/viewvc/labs/yay/trunk/api/src/main/java/org/apache/yay/Input.java?rev=1577874&r1=1577873&r2=1577874&view=diff ============================================================================== --- labs/yay/trunk/api/src/main/java/org/apache/yay/Input.java (original) +++ labs/yay/trunk/api/src/main/java/org/apache/yay/Input.java Sat Mar 15 15:03:04 2014 @@ -25,6 +25,11 @@ import java.util.ArrayList; */ public interface Input<F> { - public ArrayList<Feature<F>> getFeatures(); + /** + * Get this <code>Input</code> {@link org.apache.yay.Feature}s + * + * @return an <code>ArrayList</code> of {@link org.apache.yay.Feature}s + */ + ArrayList<Feature<F>> getFeatures(); } Modified: labs/yay/trunk/api/src/main/java/org/apache/yay/Layer.java URL: http://svn.apache.org/viewvc/labs/yay/trunk/api/src/main/java/org/apache/yay/Layer.java?rev=1577874&r1=1577873&r2=1577874&view=diff ============================================================================== --- labs/yay/trunk/api/src/main/java/org/apache/yay/Layer.java (original) +++ labs/yay/trunk/api/src/main/java/org/apache/yay/Layer.java Sat Mar 15 15:03:04 2014 @@ -25,7 +25,17 @@ import java.util.Collection; */ public interface Layer<T> { - public void add(Neuron<T> n); + /** + * Add a {@link org.apache.yay.Neuron} to this <code>Layer</code> + * + * @param n the {@link org.apache.yay.Neuron} to add + */ + void add(Neuron<T> n); - public Collection<Neuron<T>> getNeurons(); + /** + * Get the {@link org.apache.yay.Neuron}s in this <code>Layer</code> + * + * @return a <code>Collection</code> of {@link org.apache.yay.Neuron}s + */ + Collection<Neuron<T>> getNeurons(); } Modified: labs/yay/trunk/api/src/main/java/org/apache/yay/LearningStrategy.java URL: http://svn.apache.org/viewvc/labs/yay/trunk/api/src/main/java/org/apache/yay/LearningStrategy.java?rev=1577874&r1=1577873&r2=1577874&view=diff ============================================================================== --- labs/yay/trunk/api/src/main/java/org/apache/yay/LearningStrategy.java (original) +++ labs/yay/trunk/api/src/main/java/org/apache/yay/LearningStrategy.java Sat Mar 15 15:03:04 2014 @@ -26,7 +26,15 @@ import org.apache.commons.math3.linear.R */ public interface LearningStrategy<F, O> { - public RealMatrix[] learnWeights(RealMatrix[] weightsMatrixSet, TrainingSet<F, O> + /** + * Learn the weights given the current weights of a {@link org.apache.yay.NeuralNetwork} and a {@link org.apache.yay.TrainingSet} + * + * @param weightsMatrixSet an array of <code>RealMatrix</code>s representing the current weights of the {@link org.apache.yay.NeuralNetwork} + * @param trainingExamples the {@link org.apache.yay.TrainingSet} + * @return an updated array of <code>RealMatrix</code>s representing the updated weights + * @throws WeightLearningException if any error occurs while learning the weights + */ + RealMatrix[] learnWeights(RealMatrix[] weightsMatrixSet, TrainingSet<F, O> trainingExamples) throws WeightLearningException; } Modified: labs/yay/trunk/api/src/main/java/org/apache/yay/PredictionStrategy.java URL: http://svn.apache.org/viewvc/labs/yay/trunk/api/src/main/java/org/apache/yay/PredictionStrategy.java?rev=1577874&r1=1577873&r2=1577874&view=diff ============================================================================== --- labs/yay/trunk/api/src/main/java/org/apache/yay/PredictionStrategy.java (original) +++ labs/yay/trunk/api/src/main/java/org/apache/yay/PredictionStrategy.java Sat Mar 15 15:03:04 2014 @@ -18,11 +18,11 @@ */ package org.apache.yay; -import java.util.Collection; - import org.apache.commons.math3.linear.RealMatrix; import org.apache.commons.math3.linear.RealVector; +import java.util.Collection; + /** * A {@link PredictionStrategy} defines an algorithm for the prediction of outputs * of type <code>O</code> given inputs of type <code>I</code>. @@ -36,7 +36,7 @@ public interface PredictionStrategy<I, O * @param weightsMatrixSet the initial set of weights defined by an array of matrix * @return the array containing the last layer's outputs */ - public O[] predictOutput(Collection<I> inputs, RealMatrix[] weightsMatrixSet); + O[] predictOutput(Collection<I> inputs, RealMatrix[] weightsMatrixSet); /** * Perform a prediction on the given input values and weights settings returning @@ -46,6 +46,6 @@ public interface PredictionStrategy<I, O * @param weightsMatrixSet the initial set of weights defined by an array of matrix * @return the perturbed neural network state via its activations values */ - public RealVector[] debugOutput(Collection<I> inputs, RealMatrix[] weightsMatrixSet); + RealVector[] debugOutput(Collection<I> inputs, RealMatrix[] weightsMatrixSet); } Modified: labs/yay/trunk/api/src/main/java/org/apache/yay/SelectionFunction.java URL: http://svn.apache.org/viewvc/labs/yay/trunk/api/src/main/java/org/apache/yay/SelectionFunction.java?rev=1577874&r1=1577873&r2=1577874&view=diff ============================================================================== --- labs/yay/trunk/api/src/main/java/org/apache/yay/SelectionFunction.java (original) +++ labs/yay/trunk/api/src/main/java/org/apache/yay/SelectionFunction.java Sat Mar 15 15:03:04 2014 @@ -24,6 +24,12 @@ package org.apache.yay; */ public interface SelectionFunction<N, O> { - public O selectOutput(N neuralNetworkOutput); + /** + * Select one well defined single output from a given raw output + * + * @param neuralNetworkOutput the raw output of a {@link org.apache.yay.NeuralNetwork} + * @return the selected output + */ + O selectOutput(N neuralNetworkOutput); } Modified: labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingExample.java URL: http://svn.apache.org/viewvc/labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingExample.java?rev=1577874&r1=1577873&r2=1577874&view=diff ============================================================================== --- labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingExample.java (original) +++ labs/yay/trunk/api/src/main/java/org/apache/yay/TrainingExample.java Sat Mar 15 15:03:04 2014 @@ -23,6 +23,11 @@ package org.apache.yay; */ public interface TrainingExample<F, O> extends Input<F> { - public O getOutput(); + /** + * Get this sample output + * + * @return the output + */ + O getOutput(); } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@labs.apache.org For additional commands, e-mail: commits-h...@labs.apache.org