How can I implement IActivationFunction?

Suppose,
Network structure: 2 input neurons: x and 1 (bias), one hidden layer of m neurons, one output neuron.
Activation function of hidden neurons = custom function
How can we achieve that?
Activation function of output neuron = linear.
Network structure: 2 input neurons: x and 1 (bias), one hidden layer of m neurons, one output neuron.
Activation function of hidden neurons = custom function
- Code: Select all
public double Function(double h)
{
double result = 0;
result = (Math.Exp(h) - Math.Exp(-h)) / (Math.Exp(h) + Math.Exp(-h));
return result;
}
How can we achieve that?
Activation function of output neuron = linear.