Joseph Redmon
2014-04-17 ac82bde55f3206a7a0d1b7a7580bea05096af32b
src/activations.c
@@ -4,6 +4,25 @@
#include <stdio.h>
#include <string.h>
char *get_activation_string(ACTIVATION a)
{
    switch(a){
        case SIGMOID:
            return "sigmoid";
        case RELU:
            return "relu";
        case RAMP:
            return "ramp";
        case LINEAR:
            return "linear";
        case TANH:
            return "tanh";
        default:
            break;
    }
    return "relu";
}
ACTIVATION get_activation(char *s)
{
    if (strcmp(s, "sigmoid")==0) return SIGMOID;
@@ -15,7 +34,7 @@
    return RELU;
}
double activate(double x, ACTIVATION a){
float activate(float x, ACTIVATION a){
    switch(a){
        case LINEAR:
            return x;
@@ -30,7 +49,7 @@
    }
    return 0;
}
double gradient(double x, ACTIVATION a){
float gradient(float x, ACTIVATION a){
    switch(a){
        case LINEAR:
            return 1;