mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-24 07:36:24 +01:00
Add identity as activation function
This commit is contained in:
parent
179a372159
commit
fa7d8b2dbc
@ -103,7 +103,7 @@ void apply_function_to_matrix(int activation, float*** input, int depth, int dim
|
|||||||
if (activation == SOFTMAX) {
|
if (activation == SOFTMAX) {
|
||||||
return apply_softmax_input(input, depth, dim, dim);
|
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);
|
ptr f = get_activation_function(activation);
|
||||||
return apply_function_input(f, input, depth, dim, dim);
|
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) {
|
if (activation == SOFTMAX) {
|
||||||
return apply_softmax_input(input, 1, 1, dim);
|
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);
|
ptr f = get_activation_function(activation);
|
||||||
return apply_function_input(f, input, 1, 1, dim);
|
return apply_function_input(f, input, 1, 1, dim);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user