From a6b34ff809c8a9daf6a8b7993e37f73aa2c117d7 Mon Sep 17 00:00:00 2001 From: inter Date: Thu, 4 Sep 2025 14:09:16 +0800 Subject: [PATCH] Add File --- .../org/dromara/easyai/function/ReLu.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main/java/org/dromara/easyai/function/ReLu.java diff --git a/src/main/java/org/dromara/easyai/function/ReLu.java b/src/main/java/org/dromara/easyai/function/ReLu.java new file mode 100644 index 0000000..5fa803f --- /dev/null +++ b/src/main/java/org/dromara/easyai/function/ReLu.java @@ -0,0 +1,28 @@ +package org.dromara.easyai.function; + +import org.dromara.easyai.i.ActiveFunction; + +/** + * @author lidapeng + * @description ReLu 函数 + * @date 8:56 上午 2020/1/11 + */ +public class ReLu implements ActiveFunction { + @Override + public float function(float x) { + if (x > 0) { + return x; + } else { + return 0; + } + } + + @Override + public float functionG(float out) { + if (out > 0) { + return 1; + } else { + return 0; + } + } +}