public double Activate(double input)
{
switch (ActType)
{
case ActivationType.BINARY:
if (input > 0)
return 1;
else
return 0;
case ActivationType.BIPOLAR:
if (input > 0)
return 1;
else
return -1;
case ActivationType.RAMP:
return input;
case ActivationType.SIGMOID:
return 1 / (1 + Math.Pow(Math.E, -1 * input));
default:
return 0;
case ActivationType.BIPOLARSIGMOID:
return (2 / (1 + Math.Pow(Math.E, -1 * input))) - 1;
}
}