Package org.encog.neural.networks.layers

Examples of org.encog.neural.networks.layers.BasicLayer


    {
        // random matrix data.  However, it provides a constant starting point
        // for the unit tests.
       
        BasicNetwork network = new BasicNetwork();
        network.addLayer(new BasicLayer(null,true,2));
        network.addLayer(new BasicLayer(new ActivationSigmoid(),true,3));
        network.addLayer(new BasicLayer(new ActivationSigmoid(),false,3));
        network.addLayer(new BasicLayer(null,false,1));
        network.getStructure().finalizeStructure();
        (new NguyenWidrowRandomizer(-1,1)).randomize( network );
       
        return network;
    }
View Full Code Here


    }
   
    public static BasicNetwork createThreeLayerNet()
    {
      BasicNetwork network = new BasicNetwork();
      network.addLayer(new BasicLayer(2));
      network.addLayer(new BasicLayer(3));
      network.addLayer(new BasicLayer(1));
      network.getStructure().finalizeStructure();
      network.reset();
      return network;
    }
View Full Code Here

  public static double XOR_IDEAL[][] = { { 0.0 }, { 1.0 }, { 1.0 }, { 0.0 } };

  public static void main(final String args[]) {

    final BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null, true, 2));
    network.addLayer(new BasicLayer(new ActivationSigmoidPosNeg(), true, 4));
    network.addLayer(new BasicLayer(new ActivationSigmoidPosNeg(), true, 1));
    network.getStructure().finalizeStructure();
    network.reset();

    final MLDataSet trainingSet = new BasicMLDataSet(
        CustomActivation.XOR_INPUT, CustomActivation.XOR_IDEAL);
View Full Code Here

        if (layer.getCount() == 0) {
          throw new EncogError("Unknown architecture element: "
              + architecture + ", can't parse: " + part);
        }

        result.addLayer(new BasicLayer(af, bias,
            layer.getCount()));

      }
    }
View Full Code Here

   
    Encog.getInstance().registerPlugin(new EncogOpenCLPlugin());
   
    // create a neural network, without using a factory
    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
View Full Code Here

    private MLDataSet trainingSet=null;
   
    private String filePath=null;
    public NeuralNetworkWrapper(int inputNeurons,int outputNeurons){
        neuralNetwork=new BasicNetwork();
        neuralNetwork.addLayer(new BasicLayer(null,true,inputNeurons));
  neuralNetwork.addLayer(new BasicLayer(new ActivationSigmoid(),true,ProgramConfig.NEURAL_HIDDEN_LAYER_LENGTH));
  neuralNetwork.addLayer(new BasicLayer(new ActivationSigmoid(),false,outputNeurons));
  neuralNetwork.getStructure().finalizeStructure();
  neuralNetwork.reset();
       
    }
View Full Code Here

    public NeuralNetworkWrapper(String filePath,int inputNeurons,int outputNeurons){
        this.filePath=filePath;
        File file=new File(filePath);
        if(file==null || !file.exists()){
            neuralNetwork=new BasicNetwork();
            neuralNetwork.addLayer(new BasicLayer(null,true,inputNeurons));
            neuralNetwork.addLayer(new BasicLayer(new ActivationSigmoid(),true,ProgramConfig.NEURAL_HIDDEN_LAYER_LENGTH));
            neuralNetwork.addLayer(new BasicLayer(new ActivationSigmoid(),false,outputNeurons));
            neuralNetwork.getStructure().finalizeStructure();
            neuralNetwork.reset();
        }else{
            neuralNetwork=(BasicNetwork)EncogDirectoryPersistence.loadObject(file);
        }
View Full Code Here

    }

    final FlatLayer[] flatLayers = new FlatLayer[this.layers.size()];

    for (int i = 0; i < this.layers.size(); i++) {
      final BasicLayer layer = (BasicLayer) this.layers.get(i);
      if (layer.getActivation() == null) {
        layer.setActivation(new ActivationLinear());
      }

      flatLayers[i] = layer;
    }
View Full Code Here

   *
   * @return The Elman neural network.
   */
  @Override
  public MLMethod generate() {
    BasicLayer hidden, input;

    final BasicNetwork network = new BasicNetwork();
    network.addLayer(input = new BasicLayer(this.activation, true,
        this.inputNeurons));
    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;
  }
View Full Code Here

   * @return A Jordan neural network.
   */
  @Override
  public MLMethod generate() {

    BasicLayer hidden, output;

    final BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null, true,
        this.inputNeurons));
    network.addLayer(hidden = new BasicLayer(this.activation, true,
        this.hiddenNeurons));
    network.addLayer(output = new BasicLayer(this.activation, false,
        this.outputNeurons));
    hidden.setContextFedBy(output);
    network.getStructure().finalizeStructure();
    network.reset();
    return network;
  }
View Full Code Here

TOP

Related Classes of org.encog.neural.networks.layers.BasicLayer

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.