Fix Sigmoid

This commit is contained in:
augustin64 2022-04-21 12:09:35 +02:00
parent 29f694d04d
commit 48a95b10db

View File

@ -17,16 +17,16 @@
float max(float a, float b){ float max(float a, float b){
return a<b?b:a; return a < b ? b : a;
} }
float sigmoid(float x){ float sigmoid(float x){
return 1/(1 + exp(x)); return 1/(1 - exp(-x));
} }
float sigmoid_derivee(float x){ float sigmoid_derivee(float x){
float tmp = sigmoid(x); float tmp = exp(-x);
return tmp*(1-tmp); return tmp/((1+tmp)*(1+tmp));
} }
float leaky_ReLU(float x){ float leaky_ReLU(float x){