Package com.neuralnetwork.shared.neurons

Examples of com.neuralnetwork.shared.neurons.InputNeuron


   * Test method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#getOutputLinks(int[])}.
   */
  @Test
  public final void testGetOutputLinks() {
    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);
   
    ILink[] l = m.getOutputLinks(0, 1);
   
View Full Code Here


     * Test method for {@link com.neuralnetwork
     * .shared.neurons.Neuron#setOutputLink(int,ILink)}.
     */
  @Test
  public final void testSetOutputLinkIntILink() {
         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);
         
          ILink[] l = m.getOutputLinks(0, 1);
          m.setOutputLink(0, l[1]);
View Full Code Here

     * Test method for {@link com.neuralnetwork
     * .shared.neurons.Neuron#setOutputLinks(ILink[])}.
     */
    @Test
    public final void testSetOutputLinkILinkArray() {
           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);
           
            ILink[] l = m.getOutputLinks(0, 1);
            m.setOutputLinks(l);
View Full Code Here

     * Test method for {@link com.neuralnetwork
     * .shared.neurons.Neuron#setInputLink(int, ILink)}.
     */
    @Test
    public final void testSetInputLink() {
      Neuron n = new InputNeuron();  
        Neuron n1 = new InputNeuron();
        Neuron m = new HiddenNeuron();
        Neuron o = new OutputNeuron();
        Neuron o1 = new OutputNeuron();
        m.addInputLink(n);
        m.addInputLink(n1);
View Full Code Here

     * Test method for {@link com.neuralnetwork
     * .shared.neurons.Neuron#setInputs(Vector)}.
     */
    @Test
    public final void testInputs() {
      Neuron n = new InputNeuron();
        Neuron n1 = new InputNeuron();
        Neuron m = new HiddenNeuron();

        m.addInputLink(n);
        m.addInputLink(n1);
        Vector<ILink> v = new Vector<ILink>();
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);

        assertEquals(m.getInputLink(0), n.getOutputLink(0));

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();
View Full Code Here

TOP

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

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.