Package org.neuroph.core

Examples of org.neuroph.core.Neuron


  }

  @Test
  public void testOnRandomConnections() {
    // arrange
            Neuron Fromneuron=new Neuron();
    List<Connection> inputConnections = new ArrayList<Connection>();
    {
      {
        Connection connection = new Connection(Fromneuron,new Neuron(), 0.5d);
        inputConnections.add(connection);
      }
      {
        Connection connection = new Connection(Fromneuron,new Neuron(), 0.25d);
        inputConnections.add(connection);
      }
      {
        Connection connection = new Connection(Fromneuron,new Neuron(), -0.25d);
        inputConnections.add(connection);
      }
    }
   
    // act
View Full Code Here


        neuralNet.setInput(item);
        // calculate neural network output
        neuralNet.calculate();
       
        // find neuron with highest output
        Neuron maxNeuron=null;
        double maxOut = Double.NEGATIVE_INFINITY;
        for(Neuron neuron : neuralNet.getOutputNeurons()) {
            if (neuron.getOutput() > maxOut) {
                maxNeuron = neuron;
                maxOut = neuron.getOutput();
            }
        }
                          
        // and return its label
        return maxNeuron.getLabel();
    }
View Full Code Here

TOP

Related Classes of org.neuroph.core.Neuron

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.