From 0bc6cb73600330d623f8b461950931d9c0fa8721 Mon Sep 17 00:00:00 2001 From: ryota717 Date: Wed, 2 Oct 2024 15:18:30 +0900 Subject: [PATCH] fix: rename module names. --- .../{multi_armed_bandit => mab_epsilon_greedy}/LICENSE | 0 .../README.md | 10 +++++----- package/samplers/mab_epsilon_greedy/__init__.py | 4 ++++ .../example.py | 4 ++-- .../mab_epsilon_greedy.py} | 2 +- package/samplers/multi_armed_bandit/__init__.py | 4 ---- 6 files changed, 12 insertions(+), 12 deletions(-) rename package/samplers/{multi_armed_bandit => mab_epsilon_greedy}/LICENSE (100%) rename package/samplers/{multi_armed_bandit => mab_epsilon_greedy}/README.md (67%) create mode 100644 package/samplers/mab_epsilon_greedy/__init__.py rename package/samplers/{multi_armed_bandit => mab_epsilon_greedy}/example.py (82%) rename package/samplers/{multi_armed_bandit/multi_armed_bandit.py => mab_epsilon_greedy/mab_epsilon_greedy.py} (98%) delete mode 100644 package/samplers/multi_armed_bandit/__init__.py diff --git a/package/samplers/multi_armed_bandit/LICENSE b/package/samplers/mab_epsilon_greedy/LICENSE similarity index 100% rename from package/samplers/multi_armed_bandit/LICENSE rename to package/samplers/mab_epsilon_greedy/LICENSE diff --git a/package/samplers/multi_armed_bandit/README.md b/package/samplers/mab_epsilon_greedy/README.md similarity index 67% rename from package/samplers/multi_armed_bandit/README.md rename to package/samplers/mab_epsilon_greedy/README.md index 5c9aecb3..78831dab 100644 --- a/package/samplers/multi_armed_bandit/README.md +++ b/package/samplers/mab_epsilon_greedy/README.md @@ -1,6 +1,6 @@ --- author: Ryota Nishijima -title: Multi-armed Bandit Sampler +title: MAB Epsilon-Greedy Sampler description: Sampler based on multi-armed bandit algorithm with epsilon-greedy arm selection. tags: [sampler, multi-armed bandit] optuna_versions: [4.0.0] @@ -9,16 +9,16 @@ license: MIT License ## Class or Function Names -- MultiArmedBanditSampler +- MABEpsilonGreedySampler ## Example ```python -mod = optunahub.load_module("samplers/multi_armed_bandit") -sampler = mod.MultiArmedBanditSampler() +mod = optunahub.load_module("samplers/mab_epsilon_greedy") +sampler = mod.MABEpsilonGreedySampler() ``` -See [`example.py`](https://github.com/optuna/optunahub-registry/blob/main/package/samplers/multi_armed_bandit/example.py) for more details. +See [`example.py`](https://github.com/optuna/optunahub-registry/blob/main/package/samplers/mab_epsilon_greedy/example.py) for more details. ## Others diff --git a/package/samplers/mab_epsilon_greedy/__init__.py b/package/samplers/mab_epsilon_greedy/__init__.py new file mode 100644 index 00000000..5f7ee5ef --- /dev/null +++ b/package/samplers/mab_epsilon_greedy/__init__.py @@ -0,0 +1,4 @@ +from .mab_epsilon_greedy import MABEpsilonGreedySampler + + +__all__ = ["MABEpsilonGreedySampler"] diff --git a/package/samplers/multi_armed_bandit/example.py b/package/samplers/mab_epsilon_greedy/example.py similarity index 82% rename from package/samplers/multi_armed_bandit/example.py rename to package/samplers/mab_epsilon_greedy/example.py index 80c3d1ea..67298e51 100644 --- a/package/samplers/multi_armed_bandit/example.py +++ b/package/samplers/mab_epsilon_greedy/example.py @@ -4,9 +4,9 @@ if __name__ == "__main__": module = optunahub.load_module( - package="samplers/multi_armed_bandit", + package="samplers/mab_epsilon_greedy", ) - sampler = module.MultiArmedBanditSampler() + sampler = module.MABEpsilonGreedySampler() def objective(trial: optuna.Trial) -> float: x = trial.suggest_categorical("arm_1", [1, 2, 3]) diff --git a/package/samplers/multi_armed_bandit/multi_armed_bandit.py b/package/samplers/mab_epsilon_greedy/mab_epsilon_greedy.py similarity index 98% rename from package/samplers/multi_armed_bandit/multi_armed_bandit.py rename to package/samplers/mab_epsilon_greedy/mab_epsilon_greedy.py index 7fcf35b8..b43ef1ea 100644 --- a/package/samplers/multi_armed_bandit/multi_armed_bandit.py +++ b/package/samplers/mab_epsilon_greedy/mab_epsilon_greedy.py @@ -10,7 +10,7 @@ from optuna.trial import TrialState -class MultiArmedBanditSampler(RandomSampler): +class MABEpsilonGreedySampler(RandomSampler): """Sampler based on Multi-armed Bandit Algorithm. Args: diff --git a/package/samplers/multi_armed_bandit/__init__.py b/package/samplers/multi_armed_bandit/__init__.py deleted file mode 100644 index 0581651e..00000000 --- a/package/samplers/multi_armed_bandit/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .multi_armed_bandit import MultiArmedBanditSampler - - -__all__ = ["MultiArmedBanditSampler"]