From dcca60a694023103e3207030fd5a0880813b23f4 Mon Sep 17 00:00:00 2001 From: Smruti <121166411+Smruti0603@users.noreply.github.com> Date: Fri, 23 Dec 2022 18:07:27 +0530 Subject: [PATCH] testing tanh --- MLlib/tests/test_demo.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/MLlib/tests/test_demo.py b/MLlib/tests/test_demo.py index 8f7922c..9776657 100644 --- a/MLlib/tests/test_demo.py +++ b/MLlib/tests/test_demo.py @@ -1,5 +1,25 @@ + +from MLlib.activations import TanH +from MLlib.activations import Softmax +import numpy as np + def test_1(): assert 2 == 2.0 def test_2(): - assert type(5) is int \ No newline at end of file + assert type(5) is int + +def test_tanh_fuction(): + # X= np.array([0]) + X = np.array([ 0 , 0 ,0 ]) + + assert (TanH.activation(X) == np.array([[ 0 , 0 , 0] ])).all() + assert (TanH.derivative(X) == np.array([1 , 1 , 1])).all() + + + + + + + +