Package com.neuralnetwork.shared.neurons

Examples of com.neuralnetwork.shared.neurons.Neuron


   * com.neuralnetwork.shared.neurons.INeuron,
   * com.neuralnetwork.shared.values.IValue)}.
   */
  @Test
  public final void testAddOutputLinkINeuronIValueOfQ() {
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();
    Neuron m = new HiddenNeuron();
    Neuron o = new OutputNeuron();
    Neuron o1 = new OutputNeuron();
    n.addOutputLink(m, new DoubleValue(TEST_VALUE1));
    n1.addOutputLink(m, new DoubleValue(TEST_VALUE1));
    assertEquals(n.getOutputLink(0).getWeight(),
                 new DoubleValue(TEST_VALUE1));
    assertEquals(n1.getOutputLink(0).getWeight(),
View Full Code Here


   * .shared.neurons.Neuron#addOutputLink(
   * com.neuralnetwork.shared.neurons.INeuron)}.
   */
  @Test
  public final void testAddOutputLinkINeuron() {
    Neuron n = new InputNeuron()
    Neuron n1 = new InputNeuron();
    Neuron m = new HiddenNeuron();
    Neuron o = new OutputNeuron();
    Neuron o1 = new OutputNeuron();
    n.addOutputLink(m);
    assertNotNull(n.getOutputLink(0));
    n1.addOutputLink(m);
    assertNotNull(n1.getOutputLink(0));
    m.addOutputLink(o);
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.neurons.Neuron#getOutputLink(int)}.
   */
  @Test
  public final void testGetOutputLink() {
    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#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);
   
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);
         
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);
           
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);
        m.addOutputLink(o);
        m.addOutputLink(o1);
       
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>();
        v.add(m.getInputLinks(0)[0]);
        v.add(m.getInputLinks(1)[0]);
       
      m.setInputs(v);
        assertEquals(v.get(0).getHead(), m);
        assertEquals(v.get(1).getHead(), m);
        assertEquals(v.get(0).getTail(), n);
        assertEquals(v.get(1).getTail(), n1);
      m.setInputs(null);
        assertNull(m.getInputs());
        v.clear();
      m.setInputs(v);
        assertEquals(m.getInputs().size(), 0);
    }
View Full Code Here

   *
   * @return
   *     true if the reset method is not working correctly.
   */
  private boolean getResetTestResult() {
    Neuron m = new HiddenNeuron();
    Neuron o = new OutputNeuron();
    Neuron o1 = new OutputNeuron();
    m.addOutputLink(o);
    m.addOutputLink(o1);
   
    ILink[] l = m.getOutputLinks(0, 1);
    DoubleValue v = l[0].getWeight();
View Full Code Here

   * .shared.neurons.Neuron#setActivationFunction(
   * com.neuralnetwork.shared.functions.IActivationFunction)}.
   */
  @Test
  public final void testSetActivationFunction() {
    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

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.