Add identity as activation function

This commit is contained in:
julienChemillier 2023-03-12 09:34:06 +01:00
parent 179a372159
commit fa7d8b2dbc

View File

@ -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);
}