Skip to content

Commit

Permalink
Merge pull request #90 from y0z/feature/mdformat
Browse files Browse the repository at this point in the history
Introduce and apply mdformat
  • Loading branch information
HideakiImamura authored Jul 8, 2024
2 parents 6e2b480 + 8d6c229 commit 390de03
Show file tree
Hide file tree
Showing 43 changed files with 392 additions and 260 deletions.
4 changes: 3 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

Please read the [contributor agreements](https://github.com/optuna/optunahub-registry/blob/main/CONTRIBUTING.md#contributor-agreements) and if you agree, please click the checkbox below.

- [ ] I agree to the contributor agreements.
- \[ \] I agree to the contributor agreements.

## Motivation

<!-- Describe your motivation why you will submit this PR. This is useful for reviewers to understand the context of PR. -->

## Description of the changes

<!-- Describe the changes in this PR. -->
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ repos:
additional_dependencies: [
"types-PyYAML",
]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
- id: mdformat
additional_dependencies:
- mdformat-frontmatter
13 changes: 6 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ Finally, read [`contributor agreements`](#contributor-agreements) and if you agr

You can find tutorials to implement a package for the OptunaHub registry in [the OptunaHub registry documentation](https://optuna.github.io/optunahub-registry/).


## Contributor Agreements

1. By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license indicated in the file:
(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open-source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license, as indicated in the file; or
(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license indicated in the file:
(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open-source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license, as indicated in the file; or
(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

2. By making a contribution to this project, I agree that the MIT license applies to the contribution and the contribution is used by Preferred Networks (“PFN”) or third party under the MIT license.
1. By making a contribution to this project, I agree that the MIT license applies to the contribution and the contribution is used by Preferred Networks (“PFN”) or third party under the MIT license.

3. I agree that PFN may remove my contribution from the Optuna Hub at any time, if the Contribution likely violates any of applicable law and regulation, or likely infringe or misappropriate any rights of any person or entity. I ALSO AGREE THAT PFN SHALL NOT BE RESPONSIBLE OR LIABLE FOR SUCH REMOVAL OF MY CONTRIBUTION.
1. I agree that PFN may remove my contribution from the Optuna Hub at any time, if the Contribution likely violates any of applicable law and regulation, or likely infringe or misappropriate any rights of any person or entity. I ALSO AGREE THAT PFN SHALL NOT BE RESPONSIBLE OR LIABLE FOR SUCH REMOVAL OF MY CONTRIBUTION.

4. I AGREE THAT PFN SHALL NOT BE RESPONSIBLE OR LIABLE FOR USE MODIFICATION OR REMOVAL OF MY CONTRIBUTION BY THIRD PARTY.
1. I AGREE THAT PFN SHALL NOT BE RESPONSIBLE OR LIABLE FOR USE MODIFICATION OR REMOVAL OF MY CONTRIBUTION BY THIRD PARTY.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

OptunaHub Registry
==================
# OptunaHub Registry

OptunaHub Registry is a registry service for sharing and discovering user-defined Optuna packages. It provides a platform for users to share their Optuna packages with others and discover useful packages created by other users.

See the [OptunaHub Website](https://hub.optuna.org/) for registered packages.

See also the [OptunaHub API documentation](https://optuna.github.io/optunahub/) for the API to use the registry, and the [OptunaHub tutorial](https://optuna.github.io/optunahub-registry/) for how to register and discover packages.
See also the [OptunaHub API documentation](https://optuna.github.io/optunahub/) for the API to use the registry, and the [OptunaHub tutorial](https://optuna.github.io/optunahub-registry/) for how to register and discover packages.
16 changes: 9 additions & 7 deletions package/pruners/median/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
author: 'Optuna team'
title: 'Median Pruner'
description: 'Pruner using the median stopping rule.'
tags: ['pruner', 'built-in']
optuna_versions: ['3.6.1']
license: 'MIT License'
author: Optuna team
title: Median Pruner
description: Pruner using the median stopping rule.
tags: [pruner, built-in]
optuna_versions: [3.6.1]
license: MIT License
---

## Class or Function Names

- MedianPruner

## Example

```python
import optuna
from optuna.pruners import MedianPruner
Expand All @@ -33,5 +35,5 @@ study.optimize(objective, n_trials=20)
```

## Others
See the [documentation](https://optuna.readthedocs.io/en/stable/reference/generated/optuna.pruners.MedianPruner.html) for more details.

See the [documentation](https://optuna.readthedocs.io/en/stable/reference/generated/optuna.pruners.MedianPruner.html) for more details.
16 changes: 9 additions & 7 deletions package/pruners/percentile/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
author: 'Optuna team'
title: 'Percentile Pruner'
description: 'Pruner to keep the specified percentile of the trials.'
tags: ['pruner', 'built-in']
optuna_versions: ['3.6.1']
license: 'MIT License'
author: Optuna team
title: Percentile Pruner
description: Pruner to keep the specified percentile of the trials.
tags: [pruner, built-in]
optuna_versions: [3.6.1]
license: MIT License
---

## Class or Function Names

- PercentilePruner

## Example

```python
import optuna
from optuna.pruners import PercentilePruner
Expand All @@ -33,5 +35,5 @@ study.optimize(objective, n_trials=20)
```

## Others
See the [documentation](https://optuna.readthedocs.io/en/stable/reference/generated/optuna.pruners.PercentilePruner.html) for more details.

See the [documentation](https://optuna.readthedocs.io/en/stable/reference/generated/optuna.pruners.PercentilePruner.html) for more details.
17 changes: 10 additions & 7 deletions package/samplers/botorch_sampler/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
---
author: 'Optuna team'
title: 'BoTorch Sampler'
description: 'A Sampler using botorch library as the backend.'
tags: ['sampler', 'built-in']
optuna_versions: ['3.6.1']
license: 'MIT License'
author: Optuna team
title: BoTorch Sampler
description: A Sampler using botorch library as the backend.
tags: [sampler, built-in]
optuna_versions: [3.6.1]
license: MIT License
---

## Class or Function Names

- BoTorchSampler

## Installation

```bash
pip install optuna-integration botorch
```

## Example

```python
from optuna_integration import BoTorchSampler
sampler = BoTorchSampler()
```

## Others
See the [documentation](https://optuna-integration.readthedocs.io/en/latest/reference/generated/optuna_integration.BoTorchSampler.html) for more details.

See the [documentation](https://optuna-integration.readthedocs.io/en/latest/reference/generated/optuna_integration.BoTorchSampler.html) for more details.
16 changes: 9 additions & 7 deletions package/samplers/brute_force/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
author: 'Optuna team'
title: 'Brute Force Search'
description: 'Sampler using brute force.'
tags: ['sampler', 'built-in']
optuna_versions: ['3.6.1']
license: 'MIT License'
author: Optuna team
title: Brute Force Search
description: Sampler using brute force.
tags: [sampler, built-in]
optuna_versions: [3.6.1]
license: MIT License
---

## Class or Function Names

- BruteForceSampler

## Example

```python
import optuna
from optuna.samplers import BruteForceSampler
Expand All @@ -27,5 +29,5 @@ study.optimize(objective, n_trials=10)
```

## Others
See the [documentation](https://optuna.readthedocs.io/en/stable/reference/samplers/generated/optuna.samplers.BruteForceSampler.html) for more details.

See the [documentation](https://optuna.readthedocs.io/en/stable/reference/samplers/generated/optuna.samplers.BruteForceSampler.html) for more details.
16 changes: 10 additions & 6 deletions package/samplers/cmaes/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
---
author: 'Optuna team'
title: 'CMA-ES Sampler'
description: 'A sampler using cmaes as the backend.'
tags: ['sampler', 'built-in']
optuna_versions: ['3.6.1']
license: 'MIT License'
author: Optuna team
title: CMA-ES Sampler
description: A sampler using cmaes as the backend.
tags: [sampler, built-in]
optuna_versions: [3.6.1]
license: MIT License
---

## Class or Function Names

- CmaEsSampler

## Installation

```bash
pip install cmaes
```

## Example

```python
import optuna
from optuna.samplers import CmaEsSampler
Expand All @@ -33,4 +36,5 @@ study.optimize(objective, n_trials=20)
```

## Others

See the [documentation](https://optuna.readthedocs.io/en/stable/reference/samplers/generated/optuna.samplers.CmaEsSampler.html) for more details.
15 changes: 9 additions & 6 deletions package/samplers/demo/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
author: 'Optuna team'
title: 'Demo Sampler'
description: 'Demo Sampler of OptunaHub'
tags: ['sampler']
optuna_versions: ['3.6.1']
license: 'MIT License'
author: Optuna team
title: Demo Sampler
description: Demo Sampler of OptunaHub
tags: [sampler]
optuna_versions: [3.6.1]
license: MIT License
---

## Class or Function Names

- DemoSampler

## Example

```python
module = optunahub.load_module("samplers/demo")
sampler = module.DemoSampler(seed=42)
```

See [`example.py`](https://github.com/optuna/optunahub-registry/blob/main/package/samplers/demo/example.py) for more details.
15 changes: 10 additions & 5 deletions package/samplers/evo_merge/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
---
author: 'Optuna team'
title: 'Evolutionary LLM Merge Sampler'
description: 'A sampler for evolutionary LLM merge.'
tags: ['sampler', 'LLM']
author: Optuna team
title: Evolutionary LLM Merge Sampler
description: A sampler for evolutionary LLM merge.
tags: [sampler, LLM]
optuna_versions: [3.6.1]
license: 'MIT License'
license: MIT License
---

## Class or Function Names

- EvoMergeSampler
- EvoMergeTrial

## Installation

```bash
pip install git+https://github.com/arcee-ai/mergekit.git
pip install sentencepiece accelerate protobuf bitsandbytes langchain langchain-community datasets
Expand All @@ -20,6 +22,7 @@ export HF_TOKEN=xxx
```

## Example

```python
sampler = EvoMergeSampler(base_config="path/to/config/yml/file")
study = optuna.create_study(sampler=sampler)
Expand All @@ -35,6 +38,7 @@ for _ in range(100):

print(study.trials_dataframe(attrs=("number", "value")))
```

See [`example.py`](https://github.com/optuna/optunahub-registry/blob/main/package/samplers/evo_merge/example.py) for a full example. You need GPU with 16G VLAM to run this example.
The following figures are obtained from the analysis of the optimization.
![History Plot](images/history.png "History Plot")
Expand All @@ -43,4 +47,5 @@ The following figures are obtained from the analysis of the optimization.
## Others

### Reference

Akiba, T., Shing, M., Tang, Y., Sun, Q., & Ha, D. (2024). Evolutionary Optimization of Model Merging Recipes. arXiv preprint arXiv:2403.13187.
16 changes: 10 additions & 6 deletions package/samplers/gp/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
---
author: 'Optuna team'
title: 'Gaussian Process-Based Sampler'
description: 'Sampler using Gaussian process-based Bayesian optimization.'
tags: ['sampler', 'built-in']
optuna_versions: ['3.6.1']
license: 'MIT License'
author: Optuna team
title: Gaussian Process-Based Sampler
description: Sampler using Gaussian process-based Bayesian optimization.
tags: [sampler, built-in]
optuna_versions: [3.6.1]
license: MIT License
---

## Class or Function Names

- GPSampler

## Installation

```bash
pip install scipy pytorch
```

## Example

```python
import optuna
from optuna.samplers import GPSampler
Expand All @@ -32,4 +35,5 @@ study.optimize(objective, n_trials=100)
```

## Others

See the [documentation](https://optuna.readthedocs.io/en/stable/reference/samplers/generated/optuna.samplers.GPSampler.html) for more details.
15 changes: 9 additions & 6 deletions package/samplers/grid_search/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
author: 'Optuna team'
title: 'Grid Search'
description: 'Sampler using grid search.'
tags: ['sampler', 'built-in']
optuna_versions: ['3.6.1']
license: 'MIT License'
author: Optuna team
title: Grid Search
description: Sampler using grid search.
tags: [sampler, built-in]
optuna_versions: [3.6.1]
license: MIT License
---

## Class or Function Names

- GridSampler

## Example

```python
import optuna
from optuna.samplers import GridSampler
Expand All @@ -29,4 +31,5 @@ study.optimize(objective)
```

## Others

See the [documentation](https://optuna.readthedocs.io/en/stable/reference/samplers/generated/optuna.samplers.GridSampler.html) for more details.
Loading

0 comments on commit 390de03

Please sign in to comment.