From cc6e00d0915049ddd71f1347bedbb429c1795c04 Mon Sep 17 00:00:00 2001 From: SmartAI <19516876+SmartAI@users.noreply.github.com> Date: Fri, 18 Feb 2022 10:58:52 +0800 Subject: [PATCH] fix logit funciton error --- MLPP/Activation/Activation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MLPP/Activation/Activation.cpp b/MLPP/Activation/Activation.cpp index 741c49b..6e15fff 100644 --- a/MLPP/Activation/Activation.cpp +++ b/MLPP/Activation/Activation.cpp @@ -221,7 +221,7 @@ namespace MLPP{ double Activation::logit(double z, bool deriv){ if(deriv) { return 1/z - 1/(z-1); } - return std::log(z / (1 + z)); + return std::log(z / (1 - z)); } std::vector Activation::logit(std::vector z, bool deriv){ @@ -881,4 +881,4 @@ namespace MLPP{ } return a; } -} \ No newline at end of file +}