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

Tanh activation — std::tanh forward, (1-A^2) backward. More...

#include <Eigen/Dense>
#include <cmath>
Include dependency graph for Tanh.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::tanh_forward (const Eigen::MatrixXd &Z)
 Tanh forward: A = tanh(Z) elementwise.
 
Eigen::MatrixXd FlexNN::Activations::detail::tanh_backward (const Eigen::MatrixXd &dA, const Eigen::MatrixXd &, const Eigen::MatrixXd &A) noexcept
 Tanh backward: dZ = dA * (1 - A^2).
 

Detailed Description

Tanh activation — std::tanh forward, (1-A^2) backward.