Package aima.core.learning.neural

Examples of aima.core.learning.neural.IrisNNDataSet


      System.out
          .println("\n Perceptron Demo - Running Perceptron on Iris data Set with 10 epochs of learning ");
      System.out.println(Util.ntimes("*", 100));
      DataSet irisDataSet = DataSetFactory.getIrisDataSet();
      Numerizer numerizer = new IrisDataSetNumerizer();
      NNDataSet innds = new IrisNNDataSet();

      innds.createExamplesFromDataSet(irisDataSet, numerizer);

      Perceptron perc = new Perceptron(3, 4);

      perc.trainOn(innds, 10);

      innds.refreshDataset();
      int[] result = perc.testOnDataSet(innds);
      System.out.println(result[0] + " right, " + result[1] + " wrong");
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here


          .println("\n BackpropagationDemo  - Running BackProp on Iris data Set with 10 epochs of learning ");
      System.out.println(Util.ntimes("*", 100));

      DataSet irisDataSet = DataSetFactory.getIrisDataSet();
      Numerizer numerizer = new IrisDataSetNumerizer();
      NNDataSet innds = new IrisNNDataSet();

      innds.createExamplesFromDataSet(irisDataSet, numerizer);

      NNConfig config = new NNConfig();
      config.setConfig(FeedForwardNeuralNetwork.NUMBER_OF_INPUTS, 4);
      config.setConfig(FeedForwardNeuralNetwork.NUMBER_OF_OUTPUTS, 3);
      config.setConfig(FeedForwardNeuralNetwork.NUMBER_OF_HIDDEN_NEURONS,
          6);
      config
          .setConfig(FeedForwardNeuralNetwork.LOWER_LIMIT_WEIGHTS,
              -2.0);
      config.setConfig(FeedForwardNeuralNetwork.UPPER_LIMIT_WEIGHTS, 2.0);

      FeedForwardNeuralNetwork ffnn = new FeedForwardNeuralNetwork(config);
      ffnn.setTrainingScheme(new BackPropLearning(0.1, 0.9));

      ffnn.trainOn(innds, 10);

      innds.refreshDataset();
      int[] result = ffnn.testOnDataSet(innds);
      System.out.println(result[0] + " right, " + result[1] + " wrong");
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

  @Test
  public void testDataSetPopulation() throws Exception {
    DataSet irisDataSet = DataSetFactory.getIrisDataSet();
    Numerizer numerizer = new IrisDataSetNumerizer();
    NNDataSet innds = new IrisNNDataSet();

    innds.createExamplesFromDataSet(irisDataSet, numerizer);

    NNConfig config = new NNConfig();
    config.setConfig(FeedForwardNeuralNetwork.NUMBER_OF_INPUTS, 4);
    config.setConfig(FeedForwardNeuralNetwork.NUMBER_OF_OUTPUTS, 3);
    config.setConfig(FeedForwardNeuralNetwork.NUMBER_OF_HIDDEN_NEURONS, 6);
    config.setConfig(FeedForwardNeuralNetwork.LOWER_LIMIT_WEIGHTS, -2.0);
    config.setConfig(FeedForwardNeuralNetwork.UPPER_LIMIT_WEIGHTS, 2.0);

    FeedForwardNeuralNetwork ffnn = new FeedForwardNeuralNetwork(config);
    ffnn.setTrainingScheme(new BackPropLearning(0.1, 0.9));

    ffnn.trainOn(innds, 10);

    innds.refreshDataset();
    ffnn.testOnDataSet(innds);
  }
View Full Code Here

  @Test
  public void testPerceptron() throws Exception {
    DataSet irisDataSet = DataSetFactory.getIrisDataSet();
    Numerizer numerizer = new IrisDataSetNumerizer();
    NNDataSet innds = new IrisNNDataSet();

    innds.createExamplesFromDataSet(irisDataSet, numerizer);

    Perceptron perc = new Perceptron(3, 4);

    perc.trainOn(innds, 10);

    innds.refreshDataset();
    perc.testOnDataSet(innds);
  }
View Full Code Here

TOP

Related Classes of aima.core.learning.neural.IrisNNDataSet

Copyright © 2018 www.massapicom. 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.