private void buildNetwork(final Network network,int[] nodesPerLayer,Point2D initialPosition,final Neuron inputNeuronTemplate){
  setLabel("Layered Network");
  List<Neuron> inputLayerNeurons=new ArrayList<Neuron>();
  for (int i=0; i < nodesPerLayer[0]; i++) {
    inputLayerNeurons.add(new Neuron(network,inputNeuronTemplate));
  }
  NeuronGroup inputLayer=new NeuronGroup(network,inputLayerNeurons);
  inputLayer.setClamped(true);
  addNeuronGroup(inputLayer);
  inputLayer.setLayoutBasedOnSize(initialPosition);
  Synapse synapse=Synapse.getTemplateSynapse(new StaticSynapseRule());
  synapse.setLowerBound(-1);
  synapse.setUpperBound(1);
  NeuronGroup lastLayer=inputLayer;
  for (int i=1; i < nodesPerLayer.length; i++) {
    List<Neuron> hiddenLayerNeurons=new ArrayList<Neuron>();
    for (int j=0; j < nodesPerLayer[i]; j++) {
      SigmoidalRule rule=new SigmoidalRule();
      Neuron neuron=new Neuron(network,rule);
      rule.setLowerBound(0);
      neuron.setUpdatePriority(i);
      hiddenLayerNeurons.add(neuron);
    }
    NeuronGroup hiddenLayer=new NeuronGroup(network,hiddenLayerNeurons);
    hiddenLayer.setLayoutBasedOnSize();
    addNeuronGroup(hiddenLayer);
    NetworkLayoutManager.offsetNeuronGroup(lastLayer,hiddenLayer,Direction.NORTH,betweenLayerInterval);
    AllToAll connection=new AllToAll();
    SynapseGroup lh=connectNeuronGroups(lastLayer,hiddenLayer,connection);
    lh.randomizeConnectionWeights();
    lastLayer=hiddenLayer;
  }
}

private void buildNetwork ( final Network network , int [ ] nodesPerLayer , Point2D initialPosition , final Neuron inputNeuronTemplate ) { setLabel ( "Layered Network" ) ; List < Neuron > inputLayerNeurons = new ArrayList < Neuron > ( ) ; for ( int i = 0 ; i < nodesPerLayer [ 0 ] ; i ++ ) { inputLayerNeurons . add ( new Neuron ( network , inputNeuronTemplate ) ) ; } NeuronGroup inputLayer = new NeuronGroup ( network , inputLayerNeurons ) ; inputLayer . setClamped ( true ) ; addNeuronGroup ( inputLayer ) ; inputLayer . setLayoutBasedOnSize ( initialPosition ) ; Synapse synapse = Synapse . getTemplateSynapse ( new StaticSynapseRule ( ) ) ; synapse . setLowerBound ( - 1 ) ; synapse . setUpperBound ( 1 ) ; NeuronGroup lastLayer = inputLayer ; for ( int i = 1 ; i < nodesPerLayer . length ; i ++ ) { List < Neuron > hiddenLayerNeurons = new ArrayList < Neuron > ( ) ; for ( int j = 0 ; j < nodesPerLayer [ i ] ; j ++ ) { SigmoidalRule rule = new SigmoidalRule ( ) ; Neuron neuron = new Neuron ( network , rule ) ; rule . setLowerBound ( 0 ) ; neuron . setUpdatePriority ( i ) ; hiddenLayerNeurons . add ( neuron ) ; } NeuronGroup hiddenLayer = new NeuronGroup ( network , hiddenLayerNeurons ) ; hiddenLayer . setLayoutBasedOnSize ( ) ; addNeuronGroup ( hiddenLayer ) ; NetworkLayoutManager . offsetNeuronGroup ( lastLayer , hiddenLayer , Direction . NORTH , betweenLayerInterval ) ; AllToAll connection = new AllToAll ( ) ; SynapseGroup lh = connectNeuronGroups ( lastLayer , hiddenLayer , connection ) ; lh . randomizeConnectionWeights ( ) ; lastLayer = hiddenLayer ; } }
create the network using the parameters .
