shark::SoftmaxNeuron< VectorType > Struct Template Reference

Computes the softmax activation function. More...

#include <shark/Models/NeuronLayers.h>

Public Types

typedef EmptyState State
 

Public Member Functions

template<class Arg , class Device >
void evalInPlace (blas::vector_expression< Arg, Device > &arg) const
 
template<class Arg , class Device >
void evalInPlace (blas::matrix_expression< Arg, Device > &arg) const
 
template<class Arg , class Device >
void evalInPlace (blas::matrix_expression< Arg, Device > &arg, State &) const
 
template<class Output , class Derivative >
void multiplyDerivative (Output const &output, Derivative &der, State const &s) const
 

Detailed Description

template<class VectorType = RealVector>
struct shark::SoftmaxNeuron< VectorType >

Computes the softmax activation function.

\[ f_i(x)= \exp(x_i) \ \sum_j \exp(x_j) \]

computes the exponential function of the inputs and normalizes the outputs to sum to one. This is the NormalizerNeuron just without the constraint of values being positive

Definition at line 218 of file NeuronLayers.h.

Member Typedef Documentation

◆ State

template<class VectorType = RealVector>
typedef EmptyState shark::SoftmaxNeuron< VectorType >::State

Definition at line 219 of file NeuronLayers.h.

Member Function Documentation

◆ evalInPlace() [1/3]

template<class VectorType = RealVector>
template<class Arg , class Device >
void shark::SoftmaxNeuron< VectorType >::evalInPlace ( blas::matrix_expression< Arg, Device > &  arg) const
inline

Definition at line 228 of file NeuronLayers.h.

◆ evalInPlace() [2/3]

template<class VectorType = RealVector>
template<class Arg , class Device >
void shark::SoftmaxNeuron< VectorType >::evalInPlace ( blas::matrix_expression< Arg, Device > &  arg,
State  
) const
inline

Definition at line 234 of file NeuronLayers.h.

References shark::SoftmaxNeuron< VectorType >::evalInPlace().

◆ evalInPlace() [3/3]

template<class VectorType = RealVector>
template<class Arg , class Device >
void shark::SoftmaxNeuron< VectorType >::evalInPlace ( blas::vector_expression< Arg, Device > &  arg) const
inline

Definition at line 222 of file NeuronLayers.h.

Referenced by shark::SoftmaxNeuron< VectorType >::evalInPlace().

◆ multiplyDerivative()

template<class VectorType = RealVector>
template<class Output , class Derivative >
void shark::SoftmaxNeuron< VectorType >::multiplyDerivative ( Output const &  output,
Derivative &  der,
State const &  s 
) const
inline

Definition at line 239 of file NeuronLayers.h.


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