summary refs log tree commit diff
path: root/src/Math/Sigmoid.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Math/Sigmoid.hpp')
-rw-r--r--src/Math/Sigmoid.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Math/Sigmoid.hpp b/src/Math/Sigmoid.hpp
new file mode 100644
index 0000000..f2fa009
--- /dev/null
+++ b/src/Math/Sigmoid.hpp
@@ -0,0 +1,13 @@
+#pragma once
+
+#include <cmath>
+#include "Constants.hpp"
+
+namespace Math {
+
+template <typename T>
+T sigmoid(T x) {
+    return 1 / (1 + std::pow(E, -x));
+}
+
+}