Skip to content

Commit

Permalink
Merge pull request #146 from eukaryo/ingo-link
Browse files Browse the repository at this point in the history
Enhance `README.md` of INGO sampler
  • Loading branch information
y0z authored Aug 28, 2024
2 parents f91ebc7 + cdc802e commit dc2d69f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions package/samplers/implicit_natural_gradient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,36 @@ license: MIT License
## Example

```python
mod = optunahub.load_module("samplers/implicit_natural_gradient")
sampler = mod.ImplicitNaturalGradientSampler()
```
import optuna
import optunahub


def objective(trial: optuna.Trial) -> float:
x = trial.suggest_float("x", -100, 100)
y = trial.suggest_float("y", -100, 100)
return x**2 + y**2


def main() -> None:
mod = optunahub.load_module("samplers/implicit_natural_gradient")

sampler = mod.ImplicitNaturalGradientSampler()
study = optuna.create_study(sampler=sampler)
study.optimize(objective, n_trials=200)

See [`example.py`](https://github.com/optuna/optunahub-registry/blob/main/package/samplers/implicit_natural_gradient/example.py) for more details.
print(study.best_trial.value, study.best_trial.params)


if __name__ == "__main__":
main()
```

## Others

📝 [**A Natural Gradient-Based Optimization Algorithm Registered on OptunaHub**](https://medium.com/optuna/a-natural-gradient-based-optimization-algorithm-registered-on-optunahub-0dbe17cb0f7d): Blog post by Hiroki Takizawa. In the post, benchmark results are presented as shown in the figure below.

![The performance comparison results of this sampler and CMA-ES](images/ingo-performance.png)

### Reference

Yueming Lyu, Ivor W. Tsang (2019). Black-box Optimizer with Implicit Natural Gradient. arXiv:1910.04301
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dc2d69f

Please sign in to comment.