Package org.neuroph.core.learning

Examples of org.neuroph.core.learning.TrainingSet.addElement()


     * Create and run MLP with XOR training set
     */
    public static void main(String[] args) {
        // create training set (logical XOR function)
        TrainingSet trainingSet = new TrainingSet(2, 1);
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 0}, new double[]{0}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 1}, new double[]{1}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 0}, new double[]{1}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 1}, new double[]{0}));

        MultiLayerPerceptron nnet = new MultiLayerPerceptron( TransferFunctionType.TANH ,2, 3, 1);
View Full Code Here


     */
    public static void main(String[] args) {
        // create training set (logical XOR function)
        TrainingSet trainingSet = new TrainingSet(2, 1);
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 0}, new double[]{0}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 1}, new double[]{1}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 0}, new double[]{1}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 1}, new double[]{0}));

        MultiLayerPerceptron nnet = new MultiLayerPerceptron( TransferFunctionType.TANH ,2, 3, 1);
        MatrixMultiLayerPerceptron mnet = new MatrixMultiLayerPerceptron(nnet);
View Full Code Here

    public static void main(String[] args) {
        // create training set (logical XOR function)
        TrainingSet trainingSet = new TrainingSet(2, 1);
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 0}, new double[]{0}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 1}, new double[]{1}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 0}, new double[]{1}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 1}, new double[]{0}));

        MultiLayerPerceptron nnet = new MultiLayerPerceptron( TransferFunctionType.TANH ,2, 3, 1);
        MatrixMultiLayerPerceptron mnet = new MatrixMultiLayerPerceptron(nnet);
View Full Code Here

        // create training set (logical XOR function)
        TrainingSet trainingSet = new TrainingSet(2, 1);
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 0}, new double[]{0}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 1}, new double[]{1}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 0}, new double[]{1}));
        trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 1}, new double[]{0}));

        MultiLayerPerceptron nnet = new MultiLayerPerceptron( TransferFunctionType.TANH ,2, 3, 1);
        MatrixMultiLayerPerceptron mnet = new MatrixMultiLayerPerceptron(nnet);

        System.out.println("Training network...");
View Full Code Here

     */
    public static void main(String args[]) {
            // create training set (logical AND function)
            TrainingSet trainingSet = new TrainingSet(2, 1);
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 0}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 1}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 0}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 1}, new double[]{1}));

            // create perceptron neural network
View Full Code Here

    public static void main(String args[]) {
            // create training set (logical AND function)
            TrainingSet trainingSet = new TrainingSet(2, 1);
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 0}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 1}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 0}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 1}, new double[]{1}));

            // create perceptron neural network
            NeuralNetwork myPerceptron = new Perceptron(2, 1);
View Full Code Here

            // create training set (logical AND function)
            TrainingSet trainingSet = new TrainingSet(2, 1);
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 0}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 1}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 0}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 1}, new double[]{1}));

            // create perceptron neural network
            NeuralNetwork myPerceptron = new Perceptron(2, 1);
            // learn the training set
View Full Code Here

            // create training set (logical AND function)
            TrainingSet trainingSet = new TrainingSet(2, 1);
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 0}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 1}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 0}, new double[]{0}));
            trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 1}, new double[]{1}));

            // create perceptron neural network
            NeuralNetwork myPerceptron = new Perceptron(2, 1);
            // learn the training set
            myPerceptron.learnInSameThread(trainingSet);
View Full Code Here

        input[index++] = this.normalizedSunspots[i];
      }

      ideal[0] = this.normalizedSunspots[year];

      result.addElement(new SupervisedTrainingElement(input, ideal));
    }
    return result;
  }

  /**
 
View Full Code Here

     */
    public static void main(String args[]) {

        // create training set (H and T letter in 3x3 grid)
        TrainingSet trainingSet = new TrainingSet();
        trainingSet.addElement(new TrainingElement(new double[]{1, 0, 1,
                                                                1, 1, 1,
                                                                1, 0, 1})); // H letter
       
        trainingSet.addElement(new TrainingElement(new double[]{1, 1, 1,
                                                                0, 1, 0,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.