package com.clutteredcode.ann.activation;

/**
 * @author cluttered.code@gmail.com
 */
public enum ActivationType {
    LINEAR,
    SIGMOID,
    TAN_H;

    /**
     * Returns the {@link com.clutteredcode.ann.activation.ActivationFunction} associated with this {@code ActivationType}.
     *
     * @return the {@link com.clutteredcode.ann.activation.ActivationFunction}.
     */
    public ActivationFunction getFunction() {
        if (this.equals(TAN_H))
            return (final double input) -> Math.tanh(input);

        if (this.equals(SIGMOID))
            return (final double input) -> 1 / (1 + Math.exp(-input));

        // Default: LINEAR
        return (final double input) -> input;
    }
}
@@ -146,16 +146,370 @@
 TAN_H;%0A%0A
+    // Singleton lambda ActivationFunction objects%0A    private static final ActivationFunction LINEAR_FUNC  = (final double input) -%3E input;%0A    private static final ActivationFunction SIGMOID_FUNC = (final double input) -%3E 1 / (1 + Math.exp(-input));%0A    private static final ActivationFunction TAN_H_FUNC   = (final double input) -%3E Math.tanh(input);%0A%0A
     /**%0A
@@ -654,17 +654,17 @@
 @return 
-t
+T
 he %7B@lin
@@ -793,23 +793,18 @@
 this
-.equals(
+ == 
 TAN_H)
-)
 %0A   
@@ -823,48 +823,18 @@
 urn 
-(final double input) -%3E Math.tanh(input)
+TAN_H_FUNC
 ;%0A%0A 
@@ -852,24 +852,20 @@
 this
-.equals(
+ == 
 SIGMOID)
 )%0A  
@@ -860,17 +860,16 @@
 SIGMOID)
-)
 %0A       
@@ -884,132 +884,49 @@
 urn 
-(final double input) -%3E 1 / (1 + Math.exp(-input));%0A%0A        // Default: LINEAR%0A        return (final double input) -%3E input
+SIGMOID_FUNC;%0A%0A        return LINEAR_FUNC
 ;%0A  

Use singleton ActivationFunction object in ActivationType