Package com.neuralnetwork.shared.network

Examples of com.neuralnetwork.shared.network.INetwork


   * Test method for {@link com.neuralnetwork
   * .shared.network.Network#build()}.
   */
  @Test
    public final void testBuild() {
    INetwork n = new Network(FIVE, FIVE, THREE,
        new int[] {FOUR, TWO, FOUR});
    n.build();
    assertNotNull(n);
  }
View Full Code Here


   * Test method for {@link com.neuralnetwork
   * .shared.network.Network#toString()}.
   */
  @Test
    public final void testToString() {
    INetwork n = new Network(FIVE, FIVE, THREE,
        new int[] {FOUR, TWO, FOUR});
    n.build();
    LOGGER.debug(n.toString());
    assertTrue(
               n.toString().contains(
               "IN(0.0) IN(0.0) IN(0.0) IN(0.0) IN(0.0)"));
  }
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.network.Network#Network(int, int, int)}.
   */
  @Test
    public final void testNetworkIntIntIntIntArray() {
    INetwork n = new Network(TWO, THREE, ONE, new int[] {THREE});
    n.build();
    assertNotNull(n);
   
    try {
      n = new Network(TWO, THREE, -ONE, new int[] {THREE});
    } catch (IllegalArgumentException e) {
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.network.Network#Network(int, int)}.
   */
  @Test
    public final void testNetworkIntInt() {
    INetwork n = new Network(FIVE, FIVE);
    n.build();
    assertNotNull(n);
  }
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.network.Network#getNeuron(int, int)}.
   */
  @Test
    public final void testGetNeuron() {
    INetwork n = new Network(FIVE, FIVE, THREE,
        new int[] {FOUR, TWO, FOUR});
    n.build();
    assertNotNull(n);
    assertNotNull(n.getNeuron(0, 0));
    assertNotNull(n.getNeuron(ONE, 0));
    assertNotNull(n.getNeuron(TWO, 0));
    assertNotNull(n.getNeuron(THREE, 0));
    assertNotNull(n.getNeuron(FOUR, 0));
    assertNotNull(n.getNeuron(0, ONE));
    assertNotNull(n.getNeuron(ONE, ONE));
    assertNotNull(n.getNeuron(TWO, ONE));
    assertNotNull(n.getNeuron(THREE, ONE));
    assertNotNull(n.getNeuron(0, TWO));
    assertNotNull(n.getNeuron(ONE, TWO));
    assertNotNull(n.getNeuron(0, THREE));
    assertNotNull(n.getNeuron(ONE, THREE));
    assertNotNull(n.getNeuron(TWO, THREE));
    assertNotNull(n.getNeuron(THREE, THREE));
    assertNotNull(n.getNeuron(0, FOUR));
    assertNotNull(n.getNeuron(ONE, FOUR));
    assertNotNull(n.getNeuron(TWO, FOUR));
    assertNotNull(n.getNeuron(THREE, FOUR));
    assertNotNull(n.getNeuron(FOUR, FOUR));

    assertNull(n.getNeuron(Integer.MAX_VALUE, 0));

    assertNull(n.getNeuron(-TWO, 0));
    assertNull(n.getNeuron(0, -TWO));
    assertNull(n.getNeuron(ONE, -TWO));
    assertNull(n.getNeuron(0, THREE * TWO));
    assertNull(n.getNeuron(-ONE, -ONE));
    assertNull(n.getNeuron(-ONE, THREE * TWO));
   
  }
 
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.network.Network#getOutputNeuron(int)}.
   */
  @Test
    public final void testGetOutputNeuron() {
    INetwork n = new Network(FIVE, FIVE, THREE,
        new int[] {FOUR, TWO, FOUR});
    n.build();
    assertEquals(n.getOutputNeuron(0).getType(), NeuronType.OUTPUT);
    assertEquals(n.getOutputNeuron(ONE).getType(), NeuronType.OUTPUT);
    assertEquals(n.getOutputNeuron(TWO).getType(), NeuronType.OUTPUT);
    assertEquals(n.getOutputNeuron(THREE).getType(), NeuronType.OUTPUT);
    assertEquals(n.getOutputNeuron(FOUR).getType(), NeuronType.OUTPUT);
    assertNull(n.getOutputNeuron(-TWO));
  }
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.network.Network#getInputNeuron(int)}.
   */
  @Test
    public final void testGetInputNeuron() {
    INetwork n = new Network(FIVE, FIVE, THREE,
        new int[] {FOUR, TWO, FOUR});
    n.build();
    assertEquals(n.getInputNeuron(0).getType(), NeuronType.INPUT);
    assertEquals(n.getInputNeuron(ONE).getType(), NeuronType.INPUT);
    assertEquals(n.getInputNeuron(TWO).getType(), NeuronType.INPUT);
    assertEquals(n.getInputNeuron(THREE).getType(), NeuronType.INPUT);
    assertEquals(n.getInputNeuron(FOUR).getType(), NeuronType.INPUT);
    assertNull(n.getInputNeuron(-TWO));
  }
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.network.Network#getHeight()}.
   */
  @Test
    public final void testGetHeight() {
    INetwork n = new Network(FIVE, FIVE, THREE,
        new int[] {FOUR, TWO, FOUR});
    n.build();
    assertEquals(FIVE, n.getHeight());
  }
View Full Code Here

     * .shared.layers.InputLayer#propagate(
     * com.neuralnetwork.shared.network.INeuralNetContext)}.
     */
    @Test
    public final void testPropagate() {
        INetwork n = new Network(Constants.FIVE, Constants.FIVE,
                                 Constants.THREE,
                                 new int[] {Constants.FOUR,
                                            Constants.TWO,
                                            Constants.FOUR});
        n.build();
        Vector<Double> values = new Vector<Double>();
        values.add(NN_INPUT_VALUE);
        values.add(NN_INPUT_VALUE);
        values.add(NN_INPUT_VALUE);
        values.add(NN_INPUT_VALUE);
        values.add(NN_INPUT_VALUE);
       
        IInputLayer l = new InputLayer(Constants.FIVE);
        l.addValues(values);
        n.setInputLayer(l);
        INeuralNetContext nnctx = new NeuralNetContext(n);
        l.propagate(nnctx);
    }   
View Full Code Here

TOP

Related Classes of com.neuralnetwork.shared.network.INetwork

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.