aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorjvech <jmvalenciae@unal.edu.co>2024-07-19 09:13:18 -0500
committerjvech <jmvalenciae@unal.edu.co>2024-07-19 09:13:18 -0500
commit13d2f9ee07a632ab09ed4eacabc57ce406a2dff0 (patch)
tree8265a1b98c651c50824a8b3887a321bd928d9962 /src/main.c
parent4a5b6b12040a87dd8319a735cc48f31a2d140e3a (diff)
add: tanh activation added
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index f3e6750..dab8bd9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -171,6 +171,7 @@ Layer * load_network(struct Configs cfg)
extern struct Activation NN_SIGMOID;
extern struct Activation NN_LEAKY_RELU;
extern struct Activation NN_LINEAR;
+ extern struct Activation NN_TANH;
Layer *network = ecalloc(cfg.network_size, sizeof(Layer));
@@ -180,6 +181,7 @@ Layer * load_network(struct Configs cfg)
else if (!strcmp("softplus", cfg.activations[i])) network[i].activation = NN_SOFTPLUS;
else if (!strcmp("leaky_relu", cfg.activations[i])) network[i].activation = NN_LEAKY_RELU;
else if (!strcmp("linear", cfg.activations[i])) network[i].activation = NN_LINEAR;
+ else if (!strcmp("tanh", cfg.activations[i])) network[i].activation = NN_TANH;
else die("load_network() Error: Unknown '%s' activation", cfg.activations[i]);
network[i].neurons = cfg.neurons[i];
Feel free to download, copy and edit any repo