From e4306dad2d7c97a9191c97fe3bfce5ed68103a6f Mon Sep 17 00:00:00 2001 From: Elkhadri Doha <doha.elkhadri@etu.ec-lyon.fr> Date: Fri, 10 Nov 2023 06:33:08 +0000 Subject: [PATCH] Upload New File --- tests/one_hot_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/one_hot_test.py diff --git a/tests/one_hot_test.py b/tests/one_hot_test.py new file mode 100644 index 0000000..e848b7b --- /dev/null +++ b/tests/one_hot_test.py @@ -0,0 +1,8 @@ +from mlp import one_hot +import numpy as np + +def one_hot_test(): + x = list(range(10)) + oh = one_hot(x) + assert oh.shape == (len(x), 10) + assert (np.sum(oh, axis=1) == np.ones((1, 10))).all() -- GitLab