Package tv.floe.metronome.classification.neuralnetworks.core

Examples of tv.floe.metronome.classification.neuralnetworks.core.Weight


 
    NeuralNetworkUtil util = new NeuralNetworkUtil();
   
    NeuralNetwork nn0 =  buildXORMLP();
    nn0.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(0));
    nn0.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(1));
    util.AccumulateWorkerNetwork( nn0 );
   
   
   
   
View Full Code Here


  public void testAverageTwoCollectedNetworks() throws Exception {
   
    NeuralNetworkUtil util = new NeuralNetworkUtil();

    NeuralNetwork nn0 =  buildXORMLP();
    nn0.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(0));
    nn0.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(1));
   
    nn0.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(0).setWeight(new Weight(2));
    nn0.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(1).setWeight(new Weight(3));
   
    nn0.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(0).setWeight(new Weight(4));
    nn0.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(1).setWeight(new Weight(5));

    // output layer
    nn0.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(0.1));
    nn0.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(0.2));
    nn0.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(2).setWeight(new Weight(0.3));
   
   
    util.AccumulateWorkerNetwork( nn0 );

    NeuralNetwork nn1 =  buildXORMLP();
    nn1.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(1));
    nn1.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(0));

    nn1.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(0).setWeight(new Weight(4));
    nn1.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(1).setWeight(new Weight(5));
   
    nn1.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(0).setWeight(new Weight(6));
    nn1.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(1).setWeight(new Weight(7));

    // output layer
    nn1.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(0.4));
    nn1.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(0.6));
    nn1.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(2).setWeight(new Weight(0.8));
   
   
    util.AccumulateWorkerNetwork( nn1 );
   
   
View Full Code Here

  public void testAverageThreeCollectedNetworks() throws Exception {
   
    NeuralNetworkUtil util = new NeuralNetworkUtil();

    NeuralNetwork nn0 =  buildXORMLP();
    nn0.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(0));
    nn0.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(1));
/*   
    nn0.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(0).setWeight(new Weight(2));
    nn0.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(1).setWeight(new Weight(3));
   
    nn0.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(0).setWeight(new Weight(4));
    nn0.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(1).setWeight(new Weight(5));

    // output layer
    nn0.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(0.1));
    nn0.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(0.2));
    nn0.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(2).setWeight(new Weight(0.3));
    */
   
    util.AccumulateWorkerNetwork( nn0 );

    NeuralNetwork nn1 =  buildXORMLP();
    nn1.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(1));
    nn1.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(0));
/*
    nn1.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(0).setWeight(new Weight(4));
    nn1.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(1).setWeight(new Weight(5));
   
    nn1.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(0).setWeight(new Weight(6));
    nn1.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(1).setWeight(new Weight(7));

    // output layer
    nn1.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(0.4));
    nn1.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(0.6));
    nn1.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(2).setWeight(new Weight(0.8));
   
*/   
    util.AccumulateWorkerNetwork( nn1 );
   

    NeuralNetwork nn2 =  buildXORMLP();
    nn2.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(2));
    nn2.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(5));
    util.AccumulateWorkerNetwork( nn2 );
   
    //NeuralNetwork nn_out = util.AverageNetworkWeights();
   
    NetworkAccumulator accumNet = NetworkAccumulator.buildAveragingNetworkFromConf(nn0.getConfig());
View Full Code Here

        for (Connection connection : neuron.getInConnections()) {

          double input = connection.getInput();
            double weightChange = this.learningRate * neuronError * input;

            Weight weight = connection.getWeight();

            if (this.isInBatchMode() == false) {            
                weight.weightChange = weightChange;               
                weight.value += weightChange;
            } else {
View Full Code Here

         
          double input = connection.getInput();
            //double weightChange = this.learningRate * neuronError * input;
          double weightChange = lrTemp * neuronError * input;

            Weight weight = connection.getWeight();

            if (this.isInBatchMode() == false) {            
                weight.weightChange = weightChange;               
                weight.value += weightChange;
            } else {
View Full Code Here

TOP

Related Classes of tv.floe.metronome.classification.neuralnetworks.core.Weight

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.