shark::DropoutNeuron< Neuron > Struct Template Reference

Wraps a given neuron type and implements dropout for it. More...

#include <shark/Models/Neurons.h>

+ Inheritance diagram for shark::DropoutNeuron< Neuron >:

Public Member Functions

 DropoutNeuron ()
 
template<class T >
function (T x) const
 
template<class T >
functionDerivative (T y) const
 
void setProbability (double probability)
 
void setStochastic (bool stochastic)
 

Detailed Description

template<class Neuron>
struct shark::DropoutNeuron< Neuron >

Wraps a given neuron type and implements dropout for it.

The function works by setting the output randomly to 0 with a 50% chance. The function assumes for the wrapped neuron type that the derivative for all points for which the output is 0, is 0. This is true for the LogisticNeuron, FastSigmoidNeuron and RectifierNeuron.

Definition at line 193 of file Neurons.h.

Constructor & Destructor Documentation

◆ DropoutNeuron()

template<class Neuron >
shark::DropoutNeuron< Neuron >::DropoutNeuron ( )
inline

Definition at line 194 of file Neurons.h.

Member Function Documentation

◆ function()

template<class Neuron >
template<class T >
T shark::DropoutNeuron< Neuron >::function ( x) const
inline

Definition at line 196 of file Neurons.h.

References shark::random::coinToss(), and shark::random::globalRng.

◆ functionDerivative()

template<class Neuron >
template<class T >
T shark::DropoutNeuron< Neuron >::functionDerivative ( y) const
inline

Definition at line 207 of file Neurons.h.

◆ setProbability()

template<class Neuron >
void shark::DropoutNeuron< Neuron >::setProbability ( double  probability)
inline

Definition at line 215 of file Neurons.h.

◆ setStochastic()

template<class Neuron >
void shark::DropoutNeuron< Neuron >::setStochastic ( bool  stochastic)
inline

Definition at line 216 of file Neurons.h.


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