Package org.encog.mathutil.randomize

Examples of org.encog.mathutil.randomize.ConsistentRandomizer


  public static final double[] EXPECTED_WEIGHTS2 = { 0.040412107263322006,1.6318492071769406,0.058742726390888546,0.43589204735120113,-0.5159917997643333,0.008112354095120074,-0.8555860696052167,0.07497410740247332,0.7668152092361858,0.9911552253200567,-0.8643149724379915,-0.26738946379986345,1.0788222265035896,0.3470739685034085,-0.8302594385878788,1.1248619976654748,0.7984891944426319,0.6841167879211988,-0.6059767178697457,-0.6729328356252361,-0.720851612348345,0.551830141185627 };
 
  public void testRPROPConsistency() {
    MLDataSet training = EncoderTrainingFactory.generateTraining(4, false);
    BasicNetwork network = EncogUtility.simpleFeedForward(4, 2, 0, 4, true);
    (new ConsistentRandomizer(-1,1,50)).randomize(network);
    ResilientPropagation rprop = new ResilientPropagation(network,training);
    for(int i=0;i<5;i++) {
      rprop.iteration();
    }
    Assert.assertArrayEquals(EXPECTED_WEIGHTS1, network.getFlat().getWeights(),0.0001);
View Full Code Here


  public void testCompleteTrain()
  {
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
   
    BasicNetwork network = EncogUtility.simpleFeedForward(2, 5, 7, 1, true);
    (new ConsistentRandomizer(-1,1)).randomize(network);
    MLTrain rprop = new ResilientPropagation(network, trainingData);
    int iteration = 0;
    do {
      rprop.iteration();
      iteration++;
View Full Code Here

    network.addLayer(new BasicLayer(null,true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,1));
    network.getStructure().finalizeStructure();
   
    (new ConsistentRandomizer(-1,1)).randomize(network);
   
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);   
   
    HessianFD testFD = new HessianFD();
    testFD.init(network, trainingData);
View Full Code Here

    network.addLayer(new BasicLayer(null,true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,2));
    network.getStructure().finalizeStructure();
   
    (new ConsistentRandomizer(-1,1)).randomize(network);
   
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL2);   
   
    HessianFD testFD = new HessianFD();
    testFD.init(network, trainingData);
View Full Code Here

    network.addLayer(new BasicLayer(null,true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,4));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,1));
    network.getStructure().finalizeStructure();
   
    (new ConsistentRandomizer(-1,1)).randomize(network);
   
    return network;
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void reset(int seed) {
    ConsistentRandomizer randomizer = new ConsistentRandomizer(-1, 1, seed);
    randomizer.randomize(this);
  }
View Full Code Here

TOP

Related Classes of org.encog.mathutil.randomize.ConsistentRandomizer

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.