Skip to content
Snippets Groups Projects
Unverified Commit 2dabd87a authored by Lennart Landsmeer's avatar Lennart Landsmeer Committed by GitHub
Browse files

ANN activation functions for NMODL: `sigmoid(x)`, `relu(x)` and `tanh(x)` (#2052)

I have been playing around a bit with getting Neural ODE's working (and
in general ANN's as black-box homeostatic mechanisms) and found arbor
lacking in ANN activation functions. Now not everybody might agree that
this is actually needed in Arbor, so I don't expect this PR to be merged
directly. But if people like the idea, here it is :)

The PR contains 3 common unary functions used in ANN's as nonlinear
activations: `sigmoid(x)`, `relu(x)` and `tanh(x)`

Here is a very minimal example of a 'neural ode':

```
NEURON {
  SUFFIX node
}

PARAMETER {
    A1 = -0.662 A2 =  0.282 A3 =  0.957
    A4 = -0.189 A5 = -1.794 A6 =  1.094
    A7 = -1.133 A8 =  0.625 A9 =  0.074
    b1 = -1.434 b2 = -0.358 b3 = -0.093
}

STATE {
    x
    y
    z
}

INITIAL {
    x = 0
    y = 1
    z = 1
}

DERIVATIVE dstate {
    x' = tanh(A1 * x + A2 * y + A3 * z + b1)
    y' = tanh(A4 * x + A5 * y + A6 * z + b2)
 ...
parent 09c30fce
No related branches found
No related tags found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment