From fa7d8b2dbc74e1e3c215252209ba3c87de04d055 Mon Sep 17 00:00:00 2001 From: julienChemillier Date: Sun, 12 Mar 2023 09:34:06 +0100 Subject: [PATCH] Add identity as activation function --- src/cnn/function.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cnn/function.c b/src/cnn/function.c index 7168641..9f1e1ce 100644 --- a/src/cnn/function.c +++ b/src/cnn/function.c @@ -103,7 +103,7 @@ void apply_function_to_matrix(int activation, float*** input, int depth, int dim if (activation == SOFTMAX) { return apply_softmax_input(input, depth, dim, dim); } - if (activation > 1) { // Exclude negative values (derivative) and 1 (identity) + if (activation >= 1) { // Exclude negative values (derivative) ptr f = get_activation_function(activation); return apply_function_input(f, input, depth, dim, dim); } @@ -116,7 +116,7 @@ void apply_function_to_vector(int activation, float*** input, int dim) { if (activation == SOFTMAX) { return apply_softmax_input(input, 1, 1, dim); } - if (activation > 1) { // Exclude negative values (derivative) and 1 (identity) + if (activation >= 1) { // Exclude negative values (derivative) ptr f = get_activation_function(activation); return apply_function_input(f, input, 1, 1, dim); }