Examples of Neuron


Examples of org.apache.commons.math3.ml.neuralnet.Neuron

     */
    private Neuron findAndUpdateBestNeuron(Network net,
                                           double[] features,
                                           double learningRate) {
        while (true) {
            final Neuron best = MapUtils.findBest(features, net, distance);

            final double[] expect = best.getFeatures();
            final double[] update = computeFeatures(expect,
                                                    features,
                                                    learningRate);
            if (best.compareAndSetFeatures(expect, update)) {
                return best;
            }

            // If another thread modified the state of the winning neuron,
            // it may not be the best match anymore for the given training
View Full Code Here

Examples of org.dmg.pmml._40.Neuron

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setFromNeuron(Neuron newFromNeuron) {
    Neuron oldFromNeuron = fromNeuron;
    fromNeuron = newFromNeuron;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, _40Package.NEURAL_OUTPUT_TYPE__FROM_NEURON, oldFromNeuron, fromNeuron));
  }
View Full Code Here

Examples of org.dmg.pmml._40.Neuron

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setFromNeuron(Neuron newFromNeuron) {
    Neuron oldFromNeuron = fromNeuron;
    fromNeuron = newFromNeuron;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, _40Package.CON_TYPE__FROM_NEURON, oldFromNeuron, fromNeuron));
  }
View Full Code Here

Examples of org.neuroph.core.Neuron

  }
 
  private void createTypeConnections() {
    // input connections for the first product type
    for(int i = 0; i < 7; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(i);
      Neuron toNeuron = this.getLayerAt(typeLayerIdx).getNeuronAt(0);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // input connections for the second product type
    for(int i = 7; i < 14; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(i);
      Neuron toNeuron = this.getLayerAt(typeLayerIdx).getNeuronAt(1);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // input connections for the third product type
    for(int i = 14; i < 20; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(i);
      Neuron toNeuron = this.getLayerAt(typeLayerIdx).getNeuronAt(2);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }   
   
   
    // output connections for the first product type
    for(int i = 0; i < 7; i++) {
      Neuron fromNeuron = this.getLayerAt(typeLayerIdx).getNeuronAt(0);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(i);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // output connections for the second product type
    for(int i = 7; i < 14; i++) {
      Neuron fromNeuron = this.getLayerAt(typeLayerIdx).getNeuronAt(1);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(i);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // output connections for the third product type
    for(int i = 14; i < 20; i++) {
      Neuron fromNeuron = this.getLayerAt(typeLayerIdx).getNeuronAt(2);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(i);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }     
  }
View Full Code Here

Examples of org.neuroph.core.Neuron

    int lg[] = {2, 3, 10, 11, 16, 17};
    int sony[] = {4, 5, 6, 12, 13, 18, 19};
   
    // create samsung input sonnections
    for(int i = 0; i < 7; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(samsung[i]);
      Neuron toNeuron = this.getLayerAt(brandLayerIdx).getNeuronAt(0);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // create input connections for LG
    for(int i = 0; i < 6; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(lg[i]);
      Neuron toNeuron = this.getLayerAt(brandLayerIdx).getNeuronAt(1);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // create input connections for sony
    for(int i = 0; i < 7; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(sony[i]);
      Neuron toNeuron = this.getLayerAt(brandLayerIdx).getNeuronAt(2);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }   
   
   
    // output connections for the first brand
    for(int i = 0; i < 7; i++) {
      Neuron fromNeuron = this.getLayerAt(brandLayerIdx).getNeuronAt(0);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(samsung[i]);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // output connections for the second brand
    for(int i = 0; i < 6; i++) {
      Neuron fromNeuron = this.getLayerAt(brandLayerIdx).getNeuronAt(1);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(lg[i]);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // output connections for the third brand
    for(int i = 0; i < 7; i++) {
      Neuron fromNeuron = this.getLayerAt(brandLayerIdx).getNeuronAt(2);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(sony[i]);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }     
  } 
View Full Code Here

Examples of org.neuroph.core.Neuron

    int mid[] = {3, 5, 8, 11, 12, 14, 19};
    int high[] = {1, 6, 9, 13, 15, 17};   
   
    // input connections for the first price class
    for(int i = 0; i < 7; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(low[i]);
      Neuron toNeuron = this.getLayerAt(priceLayerIdx).getNeuronAt(0);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // input connections for the second price class
    for(int i = 0; i < 7; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(mid[i]);
      Neuron toNeuron = this.getLayerAt(priceLayerIdx).getNeuronAt(1);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // input connections for the third price class
    for(int i = 0; i < 6; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(high[i]);
      Neuron toNeuron = this.getLayerAt(priceLayerIdx).getNeuronAt(2);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }   
   
   
    // output connections for the first price class
    for(int i = 0; i < 7; i++) {
      Neuron fromNeuron = this.getLayerAt(priceLayerIdx).getNeuronAt(0);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(low[i]);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // output connections for the second price class
    for(int i = 0; i < 7; i++) {
      Neuron fromNeuron = this.getLayerAt(priceLayerIdx).getNeuronAt(1);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(mid[i]);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // output connections for the third price class
    for(int i = 0; i < 6; i++) {
      Neuron fromNeuron = this.getLayerAt(priceLayerIdx).getNeuronAt(2);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(high[i]);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }     
  }   
View Full Code Here

Examples of org.neuroph.core.Neuron

    int new_products[] = {6, 9};
    int bestsellers[] = {3, 12, 14};   
   
    // input connections for the first promo type
    for(int i = 0; i < sales.length; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(sales[i]);
      Neuron toNeuron = this.getLayerAt(promoLayerIdx).getNeuronAt(0);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // input connections for the second promo type
    for(int i = 0; i < new_products.length; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(new_products[i]);
      Neuron toNeuron = this.getLayerAt(promoLayerIdx).getNeuronAt(1);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // input connections for the third promo type
    for(int i = 0; i < bestsellers.length; i++) {
      Neuron fromNeuron = this.getLayerAt(inputLayerIdx).getNeuronAt(bestsellers[i]);
      Neuron toNeuron = this.getLayerAt(promoLayerIdx).getNeuronAt(2);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }   

    // output connections for the first promo type
    for(int i = 0; i < sales.length; i++) {
      Neuron fromNeuron = this.getLayerAt(promoLayerIdx).getNeuronAt(0);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(sales[i]);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // output connections for the second promo type
    for(int i = 0; i < new_products.length; i++) {
      Neuron fromNeuron = this.getLayerAt(promoLayerIdx).getNeuronAt(1);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(new_products[i]);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }
   
    // output connections for the third promo type
    for(int i = 0; i < bestsellers.length; i++) {
      Neuron fromNeuron = this.getLayerAt(promoLayerIdx).getNeuronAt(2);
      Neuron toNeuron = this.getLayerAt(outputLayerIdx).getNeuronAt(bestsellers[i]);
      this.createConnection(fromNeuron, toNeuron, 0.1);
    }     
  } 
View Full Code Here

Examples of org.neuroph.core.Neuron



    TransferFunction transferFunction = createTransferFunction(neuronProperties.getTransferFunctionProperties());

    Neuron neuron = null;
    Class neuronClass = neuronProperties.getNeuronType();

                // use two param constructor to create neuron
                    try {
                        Class[] paramTypes = {InputFunction.class, TransferFunction.class};
View Full Code Here

Examples of org.neuroph.core.Neuron

  public static Layer createLayer(Vector<NeuronProperties> neuronPropertiesVector) {
    Layer layer = new Layer();
   
    for(NeuronProperties neuronProperties : neuronPropertiesVector) {
      Neuron neuron = NeuronFactory.createNeuron(neuronProperties);
      layer.addNeuron(neuron);
    }
   
    return layer;
  }
View Full Code Here

Examples of org.neuroph.core.Neuron

   *
   * @return one or more image labels with the maximum output
   */
  public HashMap<String, Neuron> getMaxOutput() {
    HashMap<String, Neuron> maxOutput = new HashMap<String, Neuron>();
    Neuron maxNeuron = this.getParentNetwork().getOutputNeurons().get(0);

    for (Neuron neuron : this.getParentNetwork().getOutputNeurons()) {
      if (neuron.getOutput() > maxNeuron.getOutput())
        maxNeuron = neuron;
    }

    LabelsPlugin labels = (LabelsPlugin) this.getParentNetwork().getPlugin(
        LabelsPlugin.class);

    maxOutput.put(labels.getLabel(maxNeuron), maxNeuron);

    for (Neuron neuron : this.getParentNetwork().getOutputNeurons()) {
      if (neuron.getOutput() == maxNeuron.getOutput()) {
        maxOutput.put(labels.getLabel(neuron), neuron);
      }
    }

    return maxOutput;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.