shark::TanhNeuron Struct Reference

Neuron which computes the hyperbolic tangenst with range [-1,1]. More...

#include <shark/Models/NeuronLayers.h>

Public Types

typedef EmptyState State
 

Public Member Functions

template<class Arg >
void evalInPlace (Arg &arg) const
 
template<class Arg >
void evalInPlace (Arg &arg, State &) const
 
template<class Output , class Derivative >
void multiplyDerivative (Output const &output, Derivative &der, State const &) const
 

Detailed Description

Neuron which computes the hyperbolic tangenst with range [-1,1].

The Tanh function is

\[ f(x)=\tanh(x) = \frac 2 {1+exp^(-2x)}-1 \]

it's derivative can be computed as

\[ f'(x)= 1-f(x)^2 \]

Definition at line 44 of file NeuronLayers.h.

Member Typedef Documentation

◆ State

Definition at line 45 of file NeuronLayers.h.

Member Function Documentation

◆ evalInPlace() [1/2]

template<class Arg >
void shark::TanhNeuron::evalInPlace ( Arg &  arg) const
inline

◆ evalInPlace() [2/2]

template<class Arg >
void shark::TanhNeuron::evalInPlace ( Arg &  arg,
State  
) const
inline

Definition at line 52 of file NeuronLayers.h.

References evalInPlace().

◆ multiplyDerivative()

template<class Output , class Derivative >
void shark::TanhNeuron::multiplyDerivative ( Output const &  output,
Derivative &  der,
State const &   
) const
inline

Definition at line 57 of file NeuronLayers.h.


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