View Javadoc

1   /*
2    * Created on 26-nov-2003
3    */
4   package yawn.nn.mlp;
5   
6   /***
7    * 
8    * <p>$Id: SigmoidNode.java,v 1.8 2005/04/20 18:55:03 supermarti Exp $</p>
9    * 
10   * @author Luis Mart&iacute; (luis dot marti at uc3m dot es)
11   * @version $Revision: 1.8 $
12   */
13  public class SigmoidNode extends PerceptronNode {
14  
15      /***
16       * @param inputSize
17       */
18      public SigmoidNode(int inputSize) {
19          super(inputSize);
20      }
21  
22      public SigmoidNode() {
23          super();
24      }
25  
26      protected double df(double x) {
27          return f(x) * (1 - f(x));
28      }
29  
30      protected double f(double x) {
31          return 1 / (1 + Math.exp(-x));
32      }
33  
34  }