diff options
Diffstat (limited to 'src/activations.c')
-rw-r--r-- | src/activations.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/activations.c b/src/activations.c index 7a2d6a7..064482d 100644 --- a/src/activations.c +++ b/src/activations.c @@ -28,6 +28,8 @@ double sigmoid(double x); double dsigmoid(double x); double softplus(double x); double dsoftplus(double x); +double linear(double x); +double dlinear(double x); struct Activation NN_LEAKY_RELU = { .func = leaky_relu, @@ -49,6 +51,14 @@ struct Activation NN_SIGMOID = { .dfunc = dsigmoid }; +struct Activation NN_LINEAR = { + .func = linear, + .dfunc = dlinear, +}; + +double linear(double x) {return x;} +double dlinear(double x) {return 1.0;} + double sigmoid(double x) { return 1 / (1 + exp(-x)); } double dsigmoid(double x) { return sigmoid(x) * (1 - sigmoid(x)); } |