Package org.encog.neural.neat

Examples of org.encog.neural.neat.NEATNeuron


    List<NEATNeuron> neurons = new ArrayList<NEATNeuron>();
    ActivationFunction afSigmoid = new ActivationSigmoid();
    ActivationFunction afStep = new ActivationStep();
   
    // create the neurons
    NEATNeuron input1 = new NEATNeuron(
        NEATNeuronType.Input,
        1,
        0.1,
        0.2,
        0.3);
   
    NEATNeuron input2 = new NEATNeuron(
        NEATNeuronType.Input,
        2,
        0.1,
        0.2,
        0.3);
   
    NEATNeuron bias = new NEATNeuron(
        NEATNeuronType.Bias,
        3,
        0.1,
        0.2,
        0.3);
   
    NEATNeuron hidden1 = new NEATNeuron(
        NEATNeuronType.Hidden,
        4,
        0.1,
        0.2,
        0.3);
   
    NEATNeuron output = new NEATNeuron(
        NEATNeuronType.Output,
        5,
        0.1,
        0.2,
        0.3);
View Full Code Here


      neurons.put(neuron.getNeuronType(), neuron);
    }
   
    Assert.assertEquals(4, neurons.size());
 
    NEATNeuron output = neurons.get(NEATNeuronType.Output);
    NEATNeuron input = neurons.get(NEATNeuronType.Input);
    Assert.assertEquals(1, input.getOutputboundLinks().size());
    Assert.assertEquals(0, input.getInboundLinks().size());
    Assert.assertEquals(0, output.getOutputboundLinks().size());
    Assert.assertEquals(1, output.getInboundLinks().size());
  }
View Full Code Here

   
    final List<NEATNeuron> neurons = new ArrayList<NEATNeuron>();

    for (final Gene gene : getNeurons().getGenes()) {
      final NEATNeuronGene neuronGene = (NEATNeuronGene) gene;
      final NEATNeuron neuron = new NEATNeuron(
          neuronGene.getNeuronType(), neuronGene.getId(), neuronGene
              .getSplitY(), neuronGene.getSplitX(), neuronGene
              .getActivationResponse());

      neurons.add(neuron);
    }

    // now to create the links.
    for (final Gene gene : getLinks().getGenes()) {
      final NEATLinkGene linkGene = (NEATLinkGene) gene;
      if (linkGene.isEnabled()) {
        int element = getElementPos(linkGene.getFromNeuronID());
        final NEATNeuron fromNeuron = neurons.get(element);

        element = getElementPos(linkGene.getToNeuronID());
        if( element==-1 ) {
          System.out.println("test");
        }
        final NEATNeuron toNeuron = neurons.get(element);

        final NEATLink link = new NEATLink(linkGene.getWeight(),
            fromNeuron, toNeuron, linkGene.isRecurrent());

        fromNeuron.getOutputboundLinks().add(link);
        toNeuron.getInboundLinks().add(link);

      }
    }

    NEATNetwork network = new NEATNetwork(inputCount,
View Full Code Here

TOP

Related Classes of org.encog.neural.neat.NEATNeuron

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.