FlexNN 1
Fully connected neural network built from scratch with flexible n-layer design and multiple activations.
Loading...
Searching...
No Matches
ReLU.hpp File Reference

ReLU activation — max(0, z) forward, (z>0) backward. More...

#include <algorithm>
#include <Eigen/Dense>
Include dependency graph for ReLU.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  FlexNN
 Namespace for the FlexNN neural network library.
 
namespace  FlexNN::Activations
 
namespace  FlexNN::Activations::detail
 

Functions

Eigen::MatrixXd FlexNN::Activations::detail::relu_forward (const Eigen::MatrixXd &Z)
 ReLU forward: A = max(0, Z) elementwise.
 
Eigen::MatrixXd FlexNN::Activations::detail::relu_backward (const Eigen::MatrixXd &dA, const Eigen::MatrixXd &Z, const Eigen::MatrixXd &) noexcept
 ReLU backward: dZ = dA * (Z > 0).
 

Detailed Description

ReLU activation — max(0, z) forward, (z>0) backward.