Skip to content

Commit

Permalink
fix: rename module names.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota717 committed Oct 2, 2024
1 parent 888441c commit 0bc6cb7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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

Expand Down
4 changes: 4 additions & 0 deletions package/samplers/mab_epsilon_greedy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .mab_epsilon_greedy import MABEpsilonGreedySampler


__all__ = ["MABEpsilonGreedySampler"]
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from optuna.trial import TrialState


class MultiArmedBanditSampler(RandomSampler):
class MABEpsilonGreedySampler(RandomSampler):
"""Sampler based on Multi-armed Bandit Algorithm.
Args:
Expand Down
4 changes: 0 additions & 4 deletions package/samplers/multi_armed_bandit/__init__.py

This file was deleted.

0 comments on commit 0bc6cb7

Please sign in to comment.