Package com.neuralnetwork.shared.neurons

Examples of com.neuralnetwork.shared.neurons.Neuron


   * 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


   * com.neuralnetwork.shared.neurons.NeuronType)}.
   */
  @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 method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#Neuron()}.
   */
  @Test
  public final void testNeuron() {
    Neuron n = new InputNeuron();
    Neuron m = new InputNeuron(new ZeroValue());
    assertEquals(n, m);
  }
View Full Code Here

   * com.neuralnetwork.shared.neurons.INeuron,
   * com.neuralnetwork.shared.values.IValue)}.
   */
  @Test
  public final void testAddInputLinkINeuronIValueOfQ() {
    Neuron n = new InputNeuron();
    Neuron m = new InputNeuron();
    n.addInputLink(m, new DoubleValue(TEST_VALUE1));
    ILink l = n.getInputLink(0);
    assertEquals(l.getWeight(), new DoubleValue(TEST_VALUE1));
    assertEquals(l.getHead(), n);
    assertEquals(l.getTail(), m);
View Full Code Here

   * .shared.neurons.Neuron#addInputLink(
   * com.neuralnetwork.shared.neurons.INeuron)}.
   */
  @Test
  public final void testAddInputLinkINeuron() {
    Neuron n = new InputNeuron();
    Neuron m = new InputNeuron();
    n.addInputLink(m);
    ILink l = n.getInputLink(0);
    assertEquals(l.getHead(), n);
    assertEquals(l.getTail(), m);
  }
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#getInputLink(int)}.
   */
  @Test
  public final void testGetInputLink() {
    Neuron n = new InputNeuron();
    Neuron m = new InputNeuron();
    n.addInputLink(m);
    ILink l = n.getInputLink(0);
    assertEquals(l.getHead(), n);
    assertEquals(l.getTail(), m);
  }
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#getInputLinks(int[])}.
   */
  @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 method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#getType()}.
   */
  @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 method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#getNextParent()}.
   */
  @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);
   
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#getNextChild()}.
   */
  @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);
   
View Full Code Here

TOP

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

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.