001    package aima.learning.neural;
002    
003    
004    public class LogSigActivationFunction implements ActivationFunction {
005    
006            public double activation(double parameter) {
007    
008                    return 1.0 / (1.0 + Math.pow(Math.E, (-1.0 * parameter)));
009            }
010    
011            public double deriv(double parameter) {
012                    // parameter = induced field
013                    // e == activation
014                    double e = 1.0 / (1.0 + Math.pow(Math.E, (-1.0 * parameter)));
015                    return e * (1.0 - e);
016            }
017    }