Package com.neuralnetwork.shared.layers

Examples of com.neuralnetwork.shared.layers.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());
                  }
              }
          }
View Full Code Here


    public final void testAddHiddenLayer() {
    INetwork n = new Network(FIVE, FIVE, THREE,
        new int[] {FOUR, TWO, FOUR});
    n.addHiddenLayer(new HiddenLayer(THREE * TWO));
    n.build();
    IHiddenLayer h = n.getHiddenLayer(THREE);
    assertEquals(LayerType.HIDDEN, h.getLayerType());
    assertEquals(THREE * TWO, h.getSize());
  }
View Full Code Here

     * Test method for {@link com.neuralnetwork
     * .shared.layers.HiddenLayer#HiddenLayer(int)}.
     */
    @Test
    public final void testHiddenLayer() {
        IHiddenLayer h = new HiddenLayer(1);
        assertNotNull(h);
        assertEquals(h.getLayerType(), LayerType.HIDDEN);
    }
View Full Code Here

TOP

Related Classes of com.neuralnetwork.shared.layers.IHiddenLayer

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.