| 69 | return 2*(1-y)*y; |
| 70 | } |
| 71 | static inline float stair_gradient(float x) |
| 72 | { |
| 73 | if (floor(x) == x) return 0; |
| 74 | return 1; |
| 75 | } |
| 76 | static inline float relu_gradient(float x){return (x>0);} |
| 77 | static inline float elu_gradient(float x){return (x >= 0) + (x < 0)*(x + 1);} |
| 78 | static inline float relie_gradient(float x){return (x>0) ? 1 : .01;} |