Rename BOUND_RELU to RELU_CLIP_VALUE

This commit is contained in:
augustin64 2023-03-24 15:12:31 +01:00
parent b893f11da0
commit 7da6541937
2 changed files with 5 additions and 3 deletions

View File

@ -5,7 +5,6 @@
#include "../include/colors.h"
#include "include/function.h"
#define BOUND_RELU 15
float identity(float x) {
return x;
@ -28,7 +27,7 @@ float sigmoid_derivative(float x) {
float relu(float x) {
return fmaxf(0, fminf(x, BOUND_RELU));
return fmaxf(0, fminf(x, RELU_CLIP_VALUE));
}
float relu_derivative(float x) {
@ -40,7 +39,7 @@ float relu_derivative(float x) {
float leaky_relu(float x) {
if (x>0)
return fminf(x, BOUND_RELU);
return fminf(x, RELU_CLIP_VALUE);
return x*LEAKER;
}

View File

@ -12,6 +12,9 @@
#define LEAKER 0.2
// RELU and Leaky RELU max value
#define RELU_CLIP_VALUE 15
typedef float (*ptr)(float);
typedef ptr (*pm)();