From e8c45afc15e30c8c62e8151729246c2ec7b5992f Mon Sep 17 00:00:00 2001 From: brightening-eyes Date: Sat, 9 Sep 2023 15:20:43 +0330 Subject: [PATCH] fixing cpp errors --- src/layer/celu.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/layer/celu.cpp b/src/layer/celu.cpp index 536d31542ad2..b7a51949d30f 100644 --- a/src/layer/celu.cpp +++ b/src/layer/celu.cpp @@ -12,7 +12,9 @@ // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. -#include "relu.h" +#include "celu.h" + +#include namespace ncnn { @@ -44,7 +46,7 @@ int CeLU::forward_inplace(Mat& bottom_top_blob, const Option& opt) const for (int i = 0; i < size; i++) { - ptr[i] = std::max(0,ptr[i]) + std::min(0,alpha*(expf(x/alpha)-1)); + ptr[i] = std::max(0.0f, ptr[i]) + std::min(0.0f, alpha*(expf(ptr[i]/alpha)-1)); } }