From b0cc9964e3588432419da61b432aca31e791d1ad Mon Sep 17 00:00:00 2001 From: Sun Jin Kim <sk2521@ic.ac.uk> Date: Fri, 22 Apr 2022 17:11:15 +0100 Subject: [PATCH] update /test --- test/MetaAugment/test_aa_learner.py | 4 ++-- test/MetaAugment/test_gru_learner.py | 6 +++--- test/MetaAugment/test_randomsearch_learner.py | 6 +++--- test/README.md | 6 ++++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/test/MetaAugment/test_aa_learner.py b/test/MetaAugment/test_aa_learner.py index 08092d7a..3e280870 100644 --- a/test/MetaAugment/test_aa_learner.py +++ b/test/MetaAugment/test_aa_learner.py @@ -26,8 +26,8 @@ def test_translate_operation_tensor(): softmax = torch.nn.Softmax(dim=0) fun_num = random.randint(1, 14) - p_bins = random.randint(1, 15) - m_bins = random.randint(1, 15) + p_bins = random.randint(2, 15) + m_bins = random.randint(2, 15) agent = aal.aa_learner( sp_num=5, diff --git a/test/MetaAugment/test_gru_learner.py b/test/MetaAugment/test_gru_learner.py index 2ecb6fbd..52c2b8a2 100644 --- a/test/MetaAugment/test_gru_learner.py +++ b/test/MetaAugment/test_gru_learner.py @@ -15,8 +15,8 @@ def test_generate_new_policy(): for _ in range(40): sp_num = random.randint(1,20) fun_num = random.randint(1, 14) - p_bins = random.randint(1, 15) - m_bins = random.randint(1, 15) + p_bins = random.randint(2, 15) + m_bins = random.randint(2, 15) agent = aal.gru_learner( sp_num=sp_num, @@ -24,7 +24,7 @@ def test_generate_new_policy(): p_bins=p_bins, m_bins=m_bins ) - for _ in range(10): + for _ in range(4): new_policy = agent.generate_new_policy() assert isinstance(new_policy[0], list), new_policy diff --git a/test/MetaAugment/test_randomsearch_learner.py b/test/MetaAugment/test_randomsearch_learner.py index 83ddfef1..5b67d98e 100644 --- a/test/MetaAugment/test_randomsearch_learner.py +++ b/test/MetaAugment/test_randomsearch_learner.py @@ -17,8 +17,8 @@ def test_generate_new_policy(): for _ in range(40): sp_num = random.randint(1,20) fun_num = random.randint(1, 14) - p_bins = random.randint(1, 15) - m_bins = random.randint(1, 15) + p_bins = random.randint(2, 15) + m_bins = random.randint(2, 15) agent = aal.randomsearch_learner( sp_num=sp_num, @@ -27,7 +27,7 @@ def test_generate_new_policy(): m_bins=m_bins, discrete_p_m=discrete_p_m ) - for _ in range(10): + for _ in range(4): new_policy = agent.generate_new_policy() assert isinstance(new_policy, list), new_policy diff --git a/test/README.md b/test/README.md index 895175a2..27f6a4eb 100644 --- a/test/README.md +++ b/test/README.md @@ -1,4 +1,6 @@ -This directory contatins all unit tests and integration tests for this project, -including for the library and the web-app. +This directory contains all unit tests and integration tests for this project. + +The tests for the library can be seen in /test/MetaAugment. +The tests for the web-app can be seen in ???? Use command `pytest` in main directory to run all tests in this directory. \ No newline at end of file -- GitLab