Package com.neuralnetwork.shared.neurons

Examples of com.neuralnetwork.shared.neurons.HiddenNeuron


   * Test method for {@link com.neuralnetwork
   * .shared.links.Link#getAge()}.
   */
  @Test
    public final void testGetAge() {
    IHiddenNeuron h = new HiddenNeuron();
    IHiddenNeuron t = new HiddenNeuron();
    ILink l = new Link(h, t, new OneValue());
    l.updateWeight(new DoubleValue(-WEIGHT_TEST_VALUE2));
    l.updateWeight(new DoubleValue(-WEIGHT_TEST_VALUE2));
    l.updateWeight(new DoubleValue(-WEIGHT_TEST_VALUE2));
    l.updateWeight(new DoubleValue(-WEIGHT_TEST_VALUE2));
View Full Code Here


   * Test method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#hashCode()}.
   */
  @Test
  public final void testHashCode() {
    Neuron n = new HiddenNeuron();
    assertEquals(n.hashCode(), n.hashCode());
 
    n.setValue(null);
    n.setType(null);
    n.addOutputLink(new HiddenNeuron());
    assertEquals(n.hashCode(), n.hashCode());
    Neuron v = new OutputNeuron();
    v.setValue(null);
    v.setType(null);
    v.setActivationFunction(null);
    assertEquals(v.hashCode(), v.hashCode());
View Full Code Here

  @Test
  public final void testNeuronNeuronType() {

    Neuron n = new InputNeuron();
    Neuron m = new OutputNeuron();
    Neuron o = new HiddenNeuron();
   
    assertEquals(n.getType(), NeuronType.INPUT);
    assertEquals(m.getType(), NeuronType.OUTPUT);
    assertEquals(o.getType(), NeuronType.HIDDEN);
  }
View Full Code Here

   */
  @Test
  public final void testGetInputLinks() {   
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();
    Neuron m = new HiddenNeuron();
    m.addInputLink(n);
    m.addInputLink(n1);
    ILink[] l = m.getInputLinks(0, 1);
   
    assertEquals(l[0].getTail(), n);
    assertEquals(l[1].getTail(), n1);
   
    l = m.getInputLinks();
    assertEquals(l[0].getTail(), n);
    assertEquals(l[1].getTail(), n1);
  }
View Full Code Here

   */
  @Test
  public final void testGetType() {
    Neuron n = new InputNeuron();
    Neuron m = new OutputNeuron();
    Neuron o = new HiddenNeuron();
   
    assertEquals(n.getType(), NeuronType.INPUT);
    assertEquals(m.getType(), NeuronType.OUTPUT);
    assertEquals(o.getType(), NeuronType.HIDDEN);
  }
View Full Code Here

   */
  @Test
  public final void testGetNextParent() {
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();
    Neuron m = new HiddenNeuron();
    Neuron o = new OutputNeuron();
    Neuron o1 = new OutputNeuron();
    n.addOutputLink(m);
    n1.addOutputLink(m);
    m.addOutputLink(o);
    m.addOutputLink(o1);
   
    assertEquals(m.getNextParent(), n);
    assertEquals(m.getNextParent(), n1);
  }
View Full Code Here

   */
  @Test
  public final void testGetNextChild() {   
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();
    Neuron m = new HiddenNeuron();
    Neuron o = new OutputNeuron();
    Neuron o1 = new OutputNeuron();
    n.addOutputLink(m);
    n1.addOutputLink(m);
    m.addOutputLink(o);
    m.addOutputLink(o1);
   
    assertEquals(m.getNextChild(), o);
    assertEquals(m.getNextChild(), o1);
  }
View Full Code Here

   */
  @Test
  public final void testAddOutputLinkINeuronIValueOfQ() {
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();
    Neuron m = new HiddenNeuron();
    Neuron o = new OutputNeuron();
    Neuron o1 = new OutputNeuron();
    n.addOutputLink(m, new DoubleValue(TEST_VALUE1));
    n1.addOutputLink(m, new DoubleValue(TEST_VALUE1));
    assertEquals(n.getOutputLink(0).getWeight(),
                 new DoubleValue(TEST_VALUE1));
    assertEquals(n1.getOutputLink(0).getWeight(),
                 new DoubleValue(TEST_VALUE1));
    m.addOutputLink(o);
    m.addOutputLink(o1);
  }
View Full Code Here

   */
  @Test
  public final void testAddOutputLinkINeuron() {
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();
    Neuron m = new HiddenNeuron();
    Neuron o = new OutputNeuron();
    Neuron o1 = new OutputNeuron();
    n.addOutputLink(m);
    assertNotNull(n.getOutputLink(0));
    n1.addOutputLink(m);
    assertNotNull(n1.getOutputLink(0));
    m.addOutputLink(o);
    m.addOutputLink(o1);

    assertNotNull(m.getOutputLink(0));
    assertNotNull(m.getOutputLink(1));
  }
View Full Code Here

   */
  @Test
  public final void testGetOutputLink() {
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();
    Neuron m = new HiddenNeuron();
    Neuron o = new OutputNeuron();
    Neuron o1 = new OutputNeuron();
    n.addOutputLink(m);
    n1.addOutputLink(m);
    m.addOutputLink(o);
    m.addOutputLink(o1);
   
    assertEquals(n.getOutputLink(0).getTail(), m);
    assertEquals(n1.getOutputLink(0).getTail(), m);
  }
View Full Code Here

TOP

Related Classes of com.neuralnetwork.shared.neurons.HiddenNeuron

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.