|
|
|
@ -32,6 +32,8 @@ char *get_activation_string(ACTIVATION a) |
|
|
|
|
return "stair"; |
|
|
|
|
case HARDTAN: |
|
|
|
|
return "hardtan"; |
|
|
|
|
case LHTAN: |
|
|
|
|
return "lhtan"; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -47,6 +49,7 @@ ACTIVATION get_activation(char *s) |
|
|
|
|
if (strcmp(s, "relie")==0) return RELIE; |
|
|
|
|
if (strcmp(s, "plse")==0) return PLSE; |
|
|
|
|
if (strcmp(s, "hardtan")==0) return HARDTAN; |
|
|
|
|
if (strcmp(s, "lhtan")==0) return LHTAN; |
|
|
|
|
if (strcmp(s, "linear")==0) return LINEAR; |
|
|
|
|
if (strcmp(s, "ramp")==0) return RAMP; |
|
|
|
|
if (strcmp(s, "leaky")==0) return LEAKY; |
|
|
|
@ -83,6 +86,8 @@ float activate(float x, ACTIVATION a) |
|
|
|
|
return stair_activate(x); |
|
|
|
|
case HARDTAN: |
|
|
|
|
return hardtan_activate(x); |
|
|
|
|
case LHTAN: |
|
|
|
|
return lhtan_activate(x); |
|
|
|
|
} |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
@ -122,6 +127,8 @@ float gradient(float x, ACTIVATION a) |
|
|
|
|
return stair_gradient(x); |
|
|
|
|
case HARDTAN: |
|
|
|
|
return hardtan_gradient(x); |
|
|
|
|
case LHTAN: |
|
|
|
|
return lhtan_gradient(x); |
|
|
|
|
} |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|