Package com.neuralnetwork.shared.values

Examples of com.neuralnetwork.shared.values.OneValue


    /**
     * Constructs a new bias neuron.
     */
    public BiasNeuron() {
        super(NeuronType.BIAS, new OneValue());
    }
View Full Code Here


   * #AbstractInputNeuron(com.neuralnetwork
   * .shared.values.IValue)}.
   */
  @Test
  public final void testAbstractInputNeuronIValueOfQ() {
    AbstractInputNeuron ai = new InputNeuron(new OneValue());
    assertEquals(ai.getType(), NeuronType.INPUT);
    assertEquals(ai.getValue(), new OneValue());
  }
View Full Code Here

   * #BiasNeuron()}.
   */
  @Test
  public final void testBiasNeuron() {
    assertEquals(
        new BiasNeuron().getValue(), new OneValue());
  }
View Full Code Here

   */
  @Test
  public final void testFeedForward() {
    BiasNeuron bn = new BiasNeuron();
    bn.feedforward(null);
    bn.feedforward(new OneValue(), null);
    assertEquals(bn.getOutputValue(), 1, Constants.TEN);
  }
View Full Code Here

  @Test
  public final void testUpdateValue() {   
    DoubleValue v = new DoubleValue(D_10_32432);
    assertEquals(v.getValue(), D_10_32432, Constants.TEN
        * Math.ulp(v.getValue()));
    v.updateValue(new OneValue());
    assertEquals(v.getValue(), D_11_32432, Constants.TEN
        * Math.ulp(v.getValue()));
    v.updateValue(new DoubleValue(INITIAL_VALUE));
    assertEquals(v.getValue(), D_0_32432, Constants.TEN
        * Math.ulp(v.getValue()));
 
View Full Code Here

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

   * #getOutputValue()}.
   */
  @Test
  public final void testGetOutputValue() {
    AbstractOutputNeuron ai = new OutputNeuron();
    ai.setValue(new OneValue());
    assertEquals(ai.getType(), NeuronType.OUTPUT);
    assertEquals(ai.getOutputValue(),
                 new OneValue().getValue(), TEN * Math.ulp(1.0));
  }
 
View Full Code Here

   * .neurons.InputNeuron
   * #InputNeuron(com.neuralnetwork.shared.values.IValue)}.
   */
  @Test
  public final void testInputNeuronIValueOfQ() {
    IInputNeuron n = new InputNeuron(new OneValue());
    assertEquals(n.getType(), NeuronType.INPUT);
    assertEquals(n.getValue(), new OneValue());
  }
View Full Code Here

   * .shared.neurons.HiddenNeuron#toString()}.
   */
  @Test
  public final void testToString() {
    HiddenNeuron h = new HiddenNeuron();
    h.setValue(new OneValue());
    assertEquals(h.toString(), "HN(1.0) ");
  }
View Full Code Here

   * com.neuralnetwork.shared.values.IValue)}.
   */
  @Test
    public final void testLink() {
    INeuron n = new HiddenNeuron();
    ILink l = new Link(n, n, new OneValue());
    assertNotNull(l);
   
    try {
      new Link(null, n, new OneValue());
    } catch (NeuronLinkException e) {
      assertEquals(e.getMessage(), "Head link was null.");
    }
   
    try {
      new Link(n, null, new OneValue());
    } catch (NeuronLinkException e) {
      assertEquals(e.getMessage(), "Tail link was null.");
    }
   
    l = new Link(n, n, null);
View Full Code Here

TOP

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

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.