Package org.neuroph.core

Examples of org.neuroph.core.Connection


   *            output neuron
   * @param to
   *            input neuron
   */
  public static void createConnection(Neuron fromNeuron, Neuron toNeuron) {
    Connection connection = new Connection(fromNeuron, toNeuron);
    toNeuron.addInputConnection(connection);
  }
View Full Code Here


   *            input neuron
   * @param weightVal
   *            connection weight value
   */
  public static void createConnection(Neuron fromNeuron, Neuron toNeuron, double weightVal) {
    Connection connection = new Connection(fromNeuron, toNeuron, weightVal);
    toNeuron.addInputConnection(connection);
  }
View Full Code Here

   *            input neuron
   * @param weight
   *            connection weight
   */
  public static void createConnection(Neuron fromNeuron, Neuron toNeuron, Weight weight) {
    Connection connection = new Connection(fromNeuron, toNeuron, weight);
    toNeuron.addInputConnection(connection);
  }
View Full Code Here

      for (int j = 0; j < N; j++) {
        if (j == i)
          continue;
        Neuron ni = hopfieldLayer.getNeuronAt(i);
        Neuron nj = hopfieldLayer.getNeuronAt(j);
        Connection cij = nj.getConnectionFrom(ni);
        Connection cji = ni.getConnectionFrom(nj);
        double w = 0;
        for (int k = 0; k < M; k++) {
          TrainingElement trainingElement = trainingSet.elementAt(k);
          double pki = trainingElement.getInput()[i];
          double pkj = trainingElement.getInput()[j];
          w = w + pki * pkj;
        } // k
        cij.getWeight().setValue(w);
        cji.getWeight().setValue(w);
      } // j
    } // i

  }
View Full Code Here

  }

  private void adjustCellWeights(Neuron cell, int r) {
    Iterator<Connection> i = cell.getInputsIterator();
    while (i.hasNext()) {
      Connection conn = i.next();
      double dWeight = (learningRate / (r + 1))
          * (conn.getInput() - conn.getWeight().getValue());
      conn.getWeight().inc(dWeight);
    }// while
  }
View Full Code Here

    Fromneuron.calculate();
    Neuron toneuron1 = new Neuron(), toneuron2 = new Neuron(), toneuron3 = new Neuron();
    List<Connection> inputConnections = new ArrayList<Connection>();
    {
      {
        Connection connection = new Connection(Fromneuron, toneuron1,
            0.5d);
        inputConnections.add(connection);
      }
      {
        Connection connection = new Connection(Fromneuron, toneuron2,
            0.25d);
        inputConnections.add(connection);
      }
      {
        Connection connection = new Connection(Fromneuron, toneuron3,
            -0.25d);
        inputConnections.add(connection);
      }
    }
View Full Code Here

    // 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

TOP

Related Classes of org.neuroph.core.Connection

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.