Package com.neuralnetwork.shared.util

Examples of com.neuralnetwork.shared.util.Connections


    }

    @Override
    public synchronized void build() {

      Connections c = Connections.getInstance();
    Stack<IHiddenLayer> temp = new Stack<IHiddenLayer>();
    while (!layers.empty()) {
      temp.push(layers.pop());
    }
     
      for (int i = 0; i < numHidden; i++) {
        IHiddenLayer h = new HiddenLayer(layerSizes[i]);
        h.build();
        layers.push(h);
      }
     
    while (!temp.empty()) {
      layers.push(temp.pop());
    }
     
        inputLayer.build();
        Iterator<IHiddenLayer> i = layers.iterator();
        while (i.hasNext()) {
            i.next().build();
        }
        outputLayer.build();
       
        if (!layers.isEmpty()) {
          //Connect input layer to first hidden layer.
          c.create(inputLayer, layers.get(0));
         
          //Connect each hidden layer to its child hidden layer.
          if (layers.size() >= 2) {
              i = layers.iterator();
              while (i.hasNext()) {
                  IHiddenLayer layer = i.next();
                  if (i.hasNext()) {
                      c.create(layer, i.next());
                  }
              }
          }
         
          //Connect the output layer to the last hidden layer.
          c.create(outputLayer, layers.get(layers.size() - 1));
        } else {
          c.create(inputLayer, outputLayer);
        }
    }
View Full Code Here

TOP

Related Classes of com.neuralnetwork.shared.util.Connections

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.