NNFS
Neural network library from scratch
Loading...
Searching...
No Matches
NNFS::Softmax Class Reference

Softmax activation function. More...

#include <Softmax.hpp>

Inheritance diagram for NNFS::Softmax:
[legend]

Public Member Functions

 Softmax ()
 Construct a new Softmax object.
 
void forward (Eigen::MatrixXd &out, const Eigen::MatrixXd &x) override
 Forward pass of the softmax activation function.
 
void backward (Eigen::MatrixXd &out, const Eigen::MatrixXd &dx) override
 Backward pass of the softmax activation function.
 
void equation (Eigen::MatrixXd &out, const Eigen::MatrixXd &x)
 Softmax equation.
 
- Public Member Functions inherited from NNFS::Activation
 Activation (ActivationType activation_type)
 Construct a new Activation object.
 
- Public Member Functions inherited from NNFS::Layer
 Layer (LayerType type)
 Construct a new Layer object.
 
virtual ~Layer ()=default
 Basic destructor.
 
virtual void forward (Eigen::MatrixXd &out, const Eigen::MatrixXd &x)=0
 Forward pass of the layer.
 
virtual void backward (Eigen::MatrixXd &out, const Eigen::MatrixXd &dx)=0
 Backward pass of the layer.
 

Public Attributes

Eigen::MatrixXd _forward_output
 
- Public Attributes inherited from NNFS::Activation
ActivationType activation_type
 
- Public Attributes inherited from NNFS::Layer
LayerType type
 

Additional Inherited Members

- Protected Attributes inherited from NNFS::Activation
Eigen::MatrixXd _forward_input
 

Detailed Description

Softmax activation function.

This class implements the softmax activation function.

Constructor & Destructor Documentation

◆ Softmax()

NNFS::Softmax::Softmax ( )
inline

Construct a new Softmax object.

Member Function Documentation

◆ backward()

void NNFS::Softmax::backward ( Eigen::MatrixXd &  out,
const Eigen::MatrixXd &  dx 
)
inlineoverridevirtual

Backward pass of the softmax activation function.

Parameters
[out]outInput gradient
[in]dxOutput gradient

Implements NNFS::Layer.

◆ equation()

void NNFS::Softmax::equation ( Eigen::MatrixXd &  out,
const Eigen::MatrixXd &  x 
)
inline

Softmax equation.

Parameters
[out]outOutput of the softmax activation function
[in]xInput to the softmax activation function

◆ forward()

void NNFS::Softmax::forward ( Eigen::MatrixXd &  out,
const Eigen::MatrixXd &  x 
)
inlineoverridevirtual

Forward pass of the softmax activation function.

Parameters
[out]outOutput of the softmax activation function
[in]xInput to the softmax activation function

Implements NNFS::Layer.

Member Data Documentation

◆ _forward_output

Eigen::MatrixXd NNFS::Softmax::_forward_output

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