From c8315782b23119ba69369f1a26acdf96463cc7d2 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/TanHX.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/main/java/org/dromara/easyai/function/TanHX.java diff --git a/src/main/java/org/dromara/easyai/function/TanHX.java b/src/main/java/org/dromara/easyai/function/TanHX.java new file mode 100644 index 0000000..73d40cf --- /dev/null +++ b/src/main/java/org/dromara/easyai/function/TanHX.java @@ -0,0 +1,27 @@ +package org.dromara.easyai.function; + + +import org.dromara.easyai.i.ActiveFunction; + +/** + * @param + * @DATA + * @Author LiDaPeng + * @Description + */ +public class TanHX implements ActiveFunction { + @Override + public float function(float x) { + x = x * 0.038f; + float x1 = (float)Math.exp(x); + float x2 = (float)Math.exp(-x); + float son = x1 - x2;// ArithUtil.sub(x1, x2); + float mother = x1 + x2;// ArithUtil.add(x1, x2); + return son / mother;//ArithUtil.div(son, mother); + } + + @Override + public float functionG(float out) { + return 1 - (float)Math.pow(out, 2); + } +}