Package org.encog.neural.networks

Examples of org.encog.neural.networks.BasicNetwork.reset()


    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null,false,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,3));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,1));
    network.getStructure().finalizeStructure();
    network.reset();
    new ConsistentRandomizer(-1,1).randomize(network);

    // create training data
    MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
    final MLTrain train = new ResilientPropagation(network, trainingSet);
View Full Code Here


    if (hidden2 > 0) {
      pattern.addHiddenLayer(hidden2);
    }

    final BasicNetwork network = (BasicNetwork)pattern.generate();
    network.reset();
    return network;
  }

  /**
   * Train the neural network, using SCG training, and output status to the
View Full Code Here

    // train the neural network

    double error = Double.POSITIVE_INFINITY;
    for (int z = 0; z < this.weightTries; z++) {
      network.reset();
      final Propagation train = new ResilientPropagation(network,
          useTraining);
      final StopTrainingStrategy strat = new StopTrainingStrategy(0.001,
          5);
View Full Code Here

    network.addLayer(hidden = new BasicLayer(this.activation, true,
        this.hiddenNeurons));
    network.addLayer(new BasicLayer(null, false, this.outputNeurons));
    input.setContextFedBy(hidden);
    network.getStructure().finalizeStructure();
    network.reset();
    return network;
  }

  /**
   * Set the activation function to use on each of the layers.
View Full Code Here

        this.hiddenNeurons));
    network.addLayer(output = new BasicLayer(this.activation, false,
        this.outputNeurons));
    hidden.setContextFedBy(output);
    network.getStructure().finalizeStructure();
    network.reset();
    return network;
  }

  /**
   * Set the activation function to use on each of the layers.
View Full Code Here

    network.addLayer(new BasicLayer(activation,false,inputs)); //(inputs));
    for (Integer layerSize: layers)
      network.addLayer(new BasicLayer(activation,true,layerSize));
    network.addLayer(new BasicLayer(activation,true,outputs));
    network.getStructure().finalizeStructure();
    network.reset();
    return network;
  }

  @Override
  public String getLabel() {
View Full Code Here

    CalculateScore score = new TrainingSetScore(trainingData);
    MLMethodGeneticAlgorithm genetic = new MLMethodGeneticAlgorithm(new MethodFactory(){
      @Override
      public MLMethod factor() {
        BasicNetwork network = NetworkUtil.createXORNetworkUntrained();
        network.reset();
        return network;
      }}, score, 500);
    NetworkUtil.testTraining(trainingData,genetic,0.00001);
  }
 
View Full Code Here

    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null,true,10));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,10));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,10));
    network.getStructure().finalizeStructure();
    network.reset();

    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    BasicNetwork network2 = (BasicNetwork)EncogDirectoryPersistence.loadObject(EG_FILENAME);

    double d = EngineArray.euclideanDistance(network.getStructure().getFlat().getWeights(),
View Full Code Here

    network.addLayer(new BasicLayer(null,true,200));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,200));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,200));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,200));
    network.getStructure().finalizeStructure();
    network.reset();

    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    BasicNetwork network2 = (BasicNetwork)EncogDirectoryPersistence.loadObject(EG_FILENAME);

    double d = EngineArray.euclideanDistance(network.getStructure().getFlat().getWeights(),
View Full Code Here

    basicNetwork.addLayer(new BasicLayer(null, true, 2));
    basicNetwork.addLayer(new BasicLayer(new ActivationSigmoid(), true, 3));
    basicNetwork
        .addLayer(new BasicLayer(new ActivationSigmoid(), false, 1));
    basicNetwork.getStructure().finalizeStructure();
    basicNetwork.reset();

    FreeformNetwork freeformNetwork = new FreeformNetwork(basicNetwork);
    Assert.assertEquals(basicNetwork.getInputCount(),
        freeformNetwork.getInputCount());
    Assert.assertEquals(basicNetwork.getOutputCount(),
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.