Update src/mlpack/methods/ann/activation_functions/lisht_function.hpp

Co-authored-by: Ryan Curtin <ryan@ratml.org>
This commit is contained in:
Adam Kropp
2023-11-13 14:28:12 -05:00
committed by GitHub
co-authored by Ryan Curtin
parent bc94bb9b84
commit 8f89db7fb6
@@ -84,7 +84,9 @@ class LiSHTFunction
* @param dy The resulting derivatives.
*/
template <typename InputVecType, typename OutputVecType, typename DerivVecType>
static void Deriv(const InputVecType &x, const OutputVecType &/* y */, DerivVecType &dy)
static void Deriv(const InputVecType& x,
const OutputVecType& /* y */,
DerivVecType& dy)
{
dy = arma::tanh(x) + x % (1 - arma::pow(arma::tanh(x), 2));
}