mirror of
https://github.com/augustin64/projet-tipe
synced 2025-02-02 19:39:39 +01:00
Rename BOUND_RELU to RELU_CLIP_VALUE
This commit is contained in:
parent
b893f11da0
commit
7da6541937
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)();
|
||||
|
Loading…
Reference in New Issue
Block a user