From e2c67fcf14be903ad22281ad28a8a529a0498f4f Mon Sep 17 00:00:00 2001 From: liuht Date: Fri, 21 Apr 2023 18:03:14 +0800 Subject: [PATCH] [FIX] fix typos --- examples/example_m5/main.py | 8 ++++---- examples/example_pfs/main.py | 6 +++--- examples/workflow_by_code/main.py | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/example_m5/main.py b/examples/example_m5/main.py index a0853c4..3759bb7 100644 --- a/examples/example_m5/main.py +++ b/examples/example_m5/main.py @@ -24,7 +24,7 @@ semantic_specs = [ } ] -user_senmantic = { +user_semantic = { "Data": {"Values": ["Tabular"], "Type": "Class"}, "Task": {"Values": ["Classification"], "Type": "Class"}, "Device": {"Values": ["GPU"], "Type": "Tag"}, @@ -115,7 +115,7 @@ class M5DatasetWorkflow: rmtree(dir_path) def test(self, regenerate_flag=False): - #self.prepare_learnware(regenerate_flag) + self.prepare_learnware(regenerate_flag) self._init_learnware_market() easy_market = EasyMarket() @@ -136,7 +136,7 @@ class M5DatasetWorkflow: user_spec.save(user_spec_path) user_info = BaseUserInfo( - id=f"user_{idx}", semantic_spec=user_senmantic, stat_info={"RKMEStatSpecification": user_spec} + id=f"user_{idx}", semantic_spec=user_semantic, stat_info={"RKMEStatSpecification": user_spec} ) ( sorted_score_list, @@ -160,7 +160,7 @@ class M5DatasetWorkflow: mixture_id = " ".join([learnware.id for learnware in mixture_learnware_list]) print(f"mixture_score: {mixture_score}, mixture_learnware: {mixture_id}") - reuse_job_selector = JobSelectorReuser(learnware_list=mixture_learnware_list) + reuse_job_selector = JobSelectorReuser(learnware_list=mixture_learnware_list, use_herding=False) job_selector_predict_y = reuse_job_selector.predict(user_data=test_x) job_selector_score = m5.score(test_y, job_selector_predict_y) print(f"mixture reuse loss (job selector): {job_selector_score}") diff --git a/examples/example_pfs/main.py b/examples/example_pfs/main.py index 5d3ae6a..f42b3a9 100644 --- a/examples/example_pfs/main.py +++ b/examples/example_pfs/main.py @@ -24,7 +24,7 @@ semantic_specs = [ } ] -user_senmantic = { +user_semantic = { "Data": {"Values": ["Tabular"], "Type": "Class"}, "Task": {"Values": ["Classification"], "Type": "Class"}, "Device": {"Values": ["GPU"], "Type": "Tag"}, @@ -134,7 +134,7 @@ class PFSDatasetWorkflow: user_spec.save(user_spec_path) user_info = BaseUserInfo( - id=f"user_{idx}", semantic_spec=user_senmantic, stat_info={"RKMEStatSpecification": user_spec} + id=f"user_{idx}", semantic_spec=user_semantic, stat_info={"RKMEStatSpecification": user_spec} ) ( sorted_score_list, @@ -158,7 +158,7 @@ class PFSDatasetWorkflow: mixture_id = " ".join([learnware.id for learnware in mixture_learnware_list]) print(f"mixture_score: {mixture_score}, mixture_learnware: {mixture_id}") - reuse_job_selector = JobSelectorReuser(learnware_list=mixture_learnware_list) + reuse_job_selector = JobSelectorReuser(learnware_list=mixture_learnware_list, use_herding=False) job_selector_predict_y = reuse_job_selector.predict(user_data=test_x) job_selector_score = pfs.score(test_y, job_selector_predict_y) print(f"mixture reuse loss (job selector): {job_selector_score}") diff --git a/examples/workflow_by_code/main.py b/examples/workflow_by_code/main.py index 01f09f9..1208c52 100644 --- a/examples/workflow_by_code/main.py +++ b/examples/workflow_by_code/main.py @@ -26,7 +26,7 @@ semantic_specs = [ } ] -user_senmantic = { +user_semantic = { "Data": {"Values": ["Tabular"], "Type": "Class"}, "Task": { "Values": ["Classification"], @@ -130,7 +130,7 @@ class LearnwareMarketWorkflow: with zipfile.ZipFile(zip_path, "r") as zip_obj: zip_obj.extractall(path=unzip_dir) - user_info = BaseUserInfo(id="user_0", semantic_spec=user_senmantic) + user_info = BaseUserInfo(id="user_0", semantic_spec=user_semantic) _, single_learnware_list, _ = easy_market.search_learnware(user_info) print("User info:", user_info.get_semantic_spec()) @@ -159,7 +159,7 @@ class LearnwareMarketWorkflow: user_spec = specification.rkme.RKMEStatSpecification() user_spec.load(os.path.join(unzip_dir, "svm.json")) user_info = BaseUserInfo( - id="user_0", semantic_spec=user_senmantic, stat_info={"RKMEStatSpecification": user_spec} + id="user_0", semantic_spec=user_semantic, stat_info={"RKMEStatSpecification": user_spec} ) ( sorted_score_list,