1#include "activations.hpp"
2#include "../core/common.hpp"
6#include <cuda_runtime.h>
9#define EULER_NUMBER_F 2.71828182846f
18 return static_cast<T
>(std::min(0, std::max(x, 1)));
24 unsigned char u =
static_cast<unsigned char>(x);
26 unsigned char neighbours = u & 0xF;
27 bool alive = u & 0xF0;
33 return static_cast<T
>((alive) ? 1 : 0);
36 return static_cast<T
>(1);
39 return static_cast<T
>(0);
46 return (1 / (1 + std::pow(EULER_NUMBER_F, -x)));
T operator()(const T x) const
Functor call.
Definition activations.inl:62
T operator()(const T x) const
Functor call.
Definition activations.inl:22
T operator()(const T x) const
Functor call.
Definition activations.inl:16
T operator()(const T x) const
Functor call.
Definition activations.inl:44
T operator()(const T x) const
Functor call.
Definition activations.inl:56
T operator()(const T x) const
Functor call.
Definition activations.inl:68
T operator()(const T x) const
Functor call.
Definition activations.inl:50
Main namespace.
Definition common.hpp:33