CellularAutomata
Loading...
Searching...
No Matches
activations.hpp
1#pragma once
2
3#include "../core/common.hpp"
4
5#ifdef __CUDACC__
6#include <cuda_runtime.h>
7#endif
8
24#define ACTIVATION(name, body) \
25 template <typename T> \
26 class name \
27 { \
28 public: \
29 cudaFn T operator()(const T x) const body \
30 };
31 // End of custom_activations group
33
34namespace CellularAutomata
35{
39 namespace Activations
40 {
46 template<typename T>
47 class normal
48 {
49 public:
55 cudaFn T operator()(const T x) const;
56 };
57
63 template<typename T>
64 class life
65 {
66 public:
72 cudaFn T operator()(const T x) const;
73 };
74
80 template<typename T>
81 class sigmoid
82 {
83 public:
89 cudaFn T operator()(const T x) const;
90 };
91
97 template<typename T>
98 class tanh
99 {
100 public:
106 cudaFn T operator()(const T x) const;
107 };
108
114 template<typename T>
115 class sin
116 {
117 public:
123 cudaFn T operator()(const T x) const;
124 };
125
131 template<typename T>
132 class cos
133 {
134 public:
140 cudaFn T operator()(const T x) const;
141 };
142
148 template<typename T>
149 class tan
150 {
151 public:
157 cudaFn T operator()(const T x) const;
158 };
159 }
160}
161
162#include "activations.inl"
Periodic clamp between [-1, 1].
Definition activations.hpp:133
T operator()(const T x) const
Functor call.
Definition activations.inl:62
Rules for Conway's Game of Life.
Definition activations.hpp:65
T operator()(const T x) const
Functor call.
Definition activations.inl:22
Hard clamp between [0,1].
Definition activations.hpp:48
T operator()(const T x) const
Functor call.
Definition activations.inl:16
Smooth clamp between [0, 1].
Definition activations.hpp:82
T operator()(const T x) const
Functor call.
Definition activations.inl:44
Periodic clamp between [-1, 1].
Definition activations.hpp:116
T operator()(const T x) const
Functor call.
Definition activations.inl:56
Periodic clamp between (-inf, inf)
Definition activations.hpp:150
T operator()(const T x) const
Functor call.
Definition activations.inl:68
Smooth clamp between [-1, 1].
Definition activations.hpp:99
T operator()(const T x) const
Functor call.
Definition activations.inl:50
Main namespace.
Definition common.hpp:33