SNABSuite  0.x
Spiking Neural Architecture Benchmark Suite
Static Public Member Functions | List of all members
MNIST::ReLU Class Reference

ActivationFunction ReLU: Rectified Linear Unit. More...

#include <mnist_mlp.hpp>

Static Public Member Functions

static std::vector< Real > function (std::vector< Real > input)
 
static std::vector< Real > derivative (std::vector< Real > input)
 

Detailed Description

ActivationFunction ReLU: Rectified Linear Unit.

Definition at line 113 of file mnist_mlp.hpp.

Member Function Documentation

static std::vector<Real> MNIST::ReLU::derivative ( std::vector< Real >  input)
inlinestatic

Definition at line 122 of file mnist_mlp.hpp.

123  {
124  for (auto &i : input) {
125  i = i >= 0 ? 1.0 : 0.0;
126  }
127  return input;
128  }
static std::vector<Real> MNIST::ReLU::function ( std::vector< Real >  input)
inlinestatic

Definition at line 115 of file mnist_mlp.hpp.

116  {
117  for (auto &i : input) {
118  i = std::max(0.0, i);
119  }
120  return input;
121  }

The documentation for this class was generated from the following file: