Package com.neuralnetwork.shared.values

Examples of com.neuralnetwork.shared.values.DoubleValue


   * .shared.values.GenericValue
   * #getValue()}.
   */
  @Test
  public final void testGetValue() {
    GenericValue<Double> v = new DoubleValue();
    GenericValue<Double> v1 = new DoubleValue();
    assertEquals(v.hashCode(), v1.hashCode());
    v.setValue(D_0_1);
    v1.setValue(D_0_1);
    assertEquals(v.getValue(), v1.getValue(),
        Constants.TEN * Math.ulp(v.getValue()));
  }
 
View Full Code Here


   * .shared.values.GenericValue
   * #equals(java.lang.Object)}.
   */
  @Test
  public final void testEqualsObject() {
    GenericValue<Double> v = new DoubleValue();
    GenericValue<Double> v1 = new DoubleValue();
    assertEquals(v.hashCode(), v1.hashCode());
    v.setValue(D_0_1);
    v1.setValue(D_0_1);
    assertTrue(v.equals(v1));
    assertTrue(v.equals(v));
    v.setValue(null);
    assertFalse(v.equals(v1));
    assertFalse(v1.equals(null));
    v.setValue(D_0_001);
    assertFalse(v1.equals(v));
    v.setValue(null);
    v1.setValue(null);
    assertTrue(v1.equals(v));
  }
View Full Code Here

       
        f = new SigmoidFunction();
        f1 = null;
       
        assertFalse(f.equals(f1));
        assertFalse(f.equals(new DoubleValue(0.0)));
    }
View Full Code Here

   * .shared.neurons.OutputNeuron#toString()}.
   */
  @Test
  public final void testToString() {
    OutputNeuron o = new OutputNeuron();
    o.setValue(new DoubleValue(0.0));
    assertEquals(o.toString(), "ON(0.0) ");
  }
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.values.DoubleValue#DoubleValue()}.
   */
  @Test
  public final void testDoubleValue() {
    DoubleValue v = new DoubleValue();
    assertEquals(v.getValue(), 0.0, Constants.TEN * Math.ulp(v.getValue()));
  }
 
View Full Code Here

  @Test
    public final void testUpdateWeight() {
    IHiddenNeuron h = new HiddenNeuron();
    IHiddenNeuron t = new HiddenNeuron();
    ILink l = new Link(h, t, new ZeroValue());
    l.updateWeight(new DoubleValue(WEIGHT_TEST_VALUE));
    assertEquals(l.getWeight(), new DoubleValue(WEIGHT_TEST_VALUE));
    l.updateWeight(new DoubleValue(-WEIGHT_TEST_VALUE));
    assertEquals(l.getWeight(), new DoubleValue(0.0));
  }
View Full Code Here

  @Test
    public final void testSetWeight() {
    IHiddenNeuron h = new HiddenNeuron();
    IHiddenNeuron t = new HiddenNeuron();
    ILink l = new Link(h, t, new OneValue());
    l.setWeight(new DoubleValue(WEIGHT_TEST_VALUE3));
    assertEquals(l.getWeight(), new DoubleValue(WEIGHT_TEST_VALUE3));
  }
View Full Code Here

  @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));
    assertEquals(l.getAge(), 2 * 2);
  }
 
View Full Code Here

    Pair<Object, Object> p = new Pair<Object, Object>(null, null);
    Pair<Object, Object> p1 = new Pair<Object, Object>(null, null);
   
    assertEquals(p.hashCode(), p1.hashCode());
   
    p = new Pair<Object, Object>(null, new DoubleValue(D_0_1));
    p1 = new Pair<Object, Object>(null, new DoubleValue(D_0_1));
   
    assertEquals(p.hashCode(), p1.hashCode());
   
    p = new Pair<Object, Object>(new DoubleValue(D_0_1), null);
    p1 = new Pair<Object, Object>(new DoubleValue(D_0_1), null);
   
    assertEquals(p.hashCode(), p1.hashCode());
  }
View Full Code Here

   */
  @Test
  public final void testPair() {
    Pair<Object, Object> p =
        new Pair<Object, Object>(
            new DoubleValue(D_0_1), new DoubleValue(D_0_1));
   
    assertNotNull(p);
  }
View Full Code Here

TOP

Related Classes of com.neuralnetwork.shared.values.DoubleValue

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.