Package org.encog.neural.neat

Examples of org.encog.neural.neat.NEATLink


  }
 
  private void link(
      double weight, NEATNeuron from, NEATNeuron to, boolean recurrent)
  {
    NEATLink l = new NEATLink(weight, from, to, recurrent);
    from.getOutputboundLinks().add(l);
    to.getInboundLinks().add(l);
  }
View Full Code Here


        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);
View Full Code Here

   
    for(int i=0;i<activationFunctions.length;i++) {
      activationFunctions[i] = new ActivationSteepenedSigmoid();
    }
   
    links.add( new NEATLink(0,2,1.0));
    links.add( new NEATLink(1,2,2.0));
   
    NEATNetwork result = new NEATNetwork(1,1,links,activationFunctions);
       
    return result;
  }
View Full Code Here

      double weight = output.getData(0);
      if (Math.abs(weight) > this.minWeight) {
        weight = (Math.abs(weight) - this.minWeight) * c
            * Math.signum(weight);
        linkList.add(new NEATLink(source.getId(), target.getId(),
            weight));
      }
    }

    // now create biased links
    input.clear();
    final int d = substrate.getDimensions();
    final List<SubstrateNode> biasedNodes = substrate.getBiasedNodes();
    for (final SubstrateNode target : biasedNodes) {
      for (int i = 0; i < d; i++) {
        input.setData(d + i, target.getLocation()[i]);
      }

      final MLData output = cppn.compute(input);

      double biasWeight = output.getData(1);
      if (Math.abs(biasWeight) > this.minWeight) {
        biasWeight = (Math.abs(biasWeight) - this.minWeight) * c
            * Math.signum(biasWeight);
        linkList.add(new NEATLink(0, target.getId(), biasWeight));
      }
    }

    // check for invalid neural network
    if (linkList.size() == 0) {
View Full Code Here

TOP

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

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.