47 if (strcmp(s,
"logistic")==0)
return LOGISTIC;
48 if (strcmp(s,
"loggy")==0)
return LOGGY;
49 if (strcmp(s,
"relu")==0)
return RELU;
50 if (strcmp(s,
"elu")==0)
return ELU;
51 if (strcmp(s,
"selu")==0)
return SELU;
52 if (strcmp(s,
"relie")==0)
return RELIE;
53 if (strcmp(s,
"plse")==0)
return PLSE;
54 if (strcmp(s,
"hardtan")==0)
return HARDTAN;
55 if (strcmp(s,
"lhtan")==0)
return LHTAN;
56 if (strcmp(s,
"linear")==0)
return LINEAR;
57 if (strcmp(s,
"ramp")==0)
return RAMP;
58 if (strcmp(s,
"leaky")==0)
return LEAKY;
59 if (strcmp(s,
"tanh")==0)
return TANH;
60 if (strcmp(s,
"stair")==0)
return STAIR;
61 fprintf(stderr,
"Couldn't find activation function %s, going with ReLU\n", s);
69 return linear_activate(x);
71 return logistic_activate(x);
73 return loggy_activate(x);
75 return relu_activate(x);
77 return elu_activate(x);
79 return selu_activate(x);
81 return relie_activate(x);
83 return ramp_activate(x);
85 return leaky_activate(x);
87 return tanh_activate(x);
89 return plse_activate(x);
91 return stair_activate(x);
93 return hardtan_activate(x);
95 return lhtan_activate(x);
103 for(i = 0; i < n; ++i){
112 return linear_gradient(x);
114 return logistic_gradient(x);
116 return loggy_gradient(x);
118 return relu_gradient(x);
120 return elu_gradient(x);
122 return selu_gradient(x);
124 return relie_gradient(x);
126 return ramp_gradient(x);
128 return leaky_gradient(x);
130 return tanh_gradient(x);
132 return plse_gradient(x);
134 return stair_gradient(x);
136 return hardtan_gradient(x);
138 return lhtan_gradient(x);
146 for(i = 0; i < n; ++i){
void gradient_array(const float *x, const int n, const ACTIVATION a, float *delta)
ACTIVATION get_activation(char *s)
float activate(float x, ACTIVATION a)
float gradient(float x, ACTIVATION a)
void activate_array(float *x, const int n, const ACTIVATION a)
char * get_activation_string(ACTIVATION a)