Package com.neuralnetwork.shared.neurons

Examples of com.neuralnetwork.shared.neurons.Neuron


   * Test method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#getActivationFunction()}.
   */
  @Test
  public final void testGetActivationFunction() {
    Neuron m = new HiddenNeuron();
    Neuron o = new OutputNeuron();
    Neuron o1 = new OutputNeuron();
    m.addOutputLink(o);
    m.addOutputLink(o1);
    m.setActivationFunction(null);
    assertEquals(m.getActivationFunction(), null);
    m.setActivationFunction(new SigmoidFunction());
View Full Code Here


   * Test method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#getValue()}.
   */
  @Test
  public final void testGetValue() {
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();
   
    assertEquals(n.getValue(), new ZeroValue());
    assertEquals(n1.getValue(), new ZeroValue());
  }
View Full Code Here

   * .shared.neurons.Neuron#setValue(
   * com.neuralnetwork.shared.values.IValue)}.
   */
  @Test
  public final void testSetValue() {
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();
    n.setValue(new OneValue());
    n1.setValue(new OneValue());
    assertEquals(n.getValue(), new OneValue());
    assertEquals(n1.getValue(), new OneValue());
  }
View Full Code Here

     * Test method for {@link com.neuralnetwork
     * .shared.neurons.Neuron#feedforward()}.
     */
    @Test
    public final void testFeedforward() {
        Neuron n = new InputNeuron(new DoubleValue(D_0_1));
        Neuron n1 = new InputNeuron(new DoubleValue(D_0_1));
        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

   * .shared.neurons.Neuron
   * #equals(java.lang.Object)}.
   */
  @Test
  public final void testEqualsObject() {
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();

    assertEquals(n, n1);
    n.setType(null);
    n1.setType(null);
    assertEquals(n, n1);
    n1 = null;
    assertFalse(n.equals(n1));
    HiddenLayer n2 = new HiddenLayer(1);
    assertFalse(n.equals(n2));
    n.setActivationFunction(null);
    n1 = new InputNeuron();
    assertFalse(n.equals(n1));
    n1.setType(null);
    n1.setActivationFunction(null);
    assertEquals(n, n1);
    n.setActivationFunction(new SigmoidFunction());
    assertFalse(n.equals(n1));
   
    Neuron i = new InputNeuron();
    Neuron i1 = new InputNeuron();
    Neuron m = new HiddenNeuron();
    Neuron o = new OutputNeuron();
    Neuron o1 = new OutputNeuron();
   
    i.addOutputLink(m);
    i1.addOutputLink(m);
    m.addOutputLink(o);
    m.addOutputLink(o1);
   
    i.getNextChild();
    assertFalse(i.equals(i1));
   
    o.getNextParent();
    assertFalse(o.equals(o1));
    assertFalse(i1.equals(o1));
    Neuron k = new OutputNeuron();
    Neuron k1 = new OutputNeuron();
    k1.addOutputLink(o);
    assertFalse(k.equals(k1));
   
    Neuron l = new OutputNeuron();
    Neuron l1 = new InputNeuron();
    assertFalse(l.equals(l1));
   
    Neuron p = new OutputNeuron();
    p.setValue(new DoubleValue());
    Neuron p1 = new OutputNeuron();
    p1.setValue(new DoubleValue(Constants.TEN));
    assertFalse(p.equals(p1));
   
    p.setValue(null);
    p1.setValue(new DoubleValue(Constants.ELEVEN_D));
    assertFalse(p.equals(p1));
   
    p.setValue(null);
    p1.setValue(null);
    assertEquals(p, p1);
   
  }
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.