Skip to content

Commit

Permalink
Merge pull request #277 from kAIto47802/separate-basic-and-faq
Browse files Browse the repository at this point in the history
Separate basic and faq directories
  • Loading branch information
nabenabe0928 authored Aug 13, 2024
2 parents c1cc06b + f7e7bbf commit c9452c8
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: basic_and_faq_usages
name: basic

on:
schedule:
- cron: '0 15 * * *'
pull_request:
paths:
- 'basic_and_faq_usages/**'
- '.github/workflows/basic_and_faq_usages.yml'
- 'basic/**'
- '.github/workflows/basic.yml'

jobs:
examples:
Expand All @@ -29,14 +29,12 @@ jobs:
pip install git+https://github.com/optuna/optuna.git
python -c 'import optuna'
pip install -r basic_and_faq_usages/requirements.txt
pip install -r basic/requirements.txt
- name: Run examples
run: |
python basic_and_faq_usages/max_trials_callback.py
python basic_and_faq_usages/enqueue_trial.py
python basic_and_faq_usages/quadratic_simple.py
python basic_and_faq_usages/simple_pruning.py
python basic_and_faq_usages/quadratic_simple_constraint.py
python basic_and_faq_usages/quadratic_simple_multi_objective.py
python basic/quadratic.py
python basic/pruning.py
python basic/quadratic_constraint.py
python basic/quadratic_multi_objective.py
env:
OMP_NUM_THREADS: 1
38 changes: 38 additions & 0 deletions .github/workflows/faq.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: faq

on:
schedule:
- cron: '0 15 * * *'
pull_request:
paths:
- 'faq/**'
- '.github/workflows/faq.yml'

jobs:
examples:
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna-examples') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
- name: setup-python${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install (Python)
run: |
python -m pip install --upgrade pip
pip install --progress-bar off -U setuptools
pip install git+https://github.com/optuna/optuna.git
python -c 'import optuna'
pip install -r faq/requirements.txt
- name: Run examples
run: |
python faq/max_trials_callback.py
python faq/enqueue_trial.py
env:
OMP_NUM_THREADS: 1
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ if __name__ == "__main__":
> In this example repository, you can also find the examples for the following scenarios:
> 1. [Objective function with additional arguments](./sklearn/sklearn_additional_args.py), which is useful when you would like to pass arguments besides `trial` to your objective function.
>
> 2. [Manually provide trials with sampler](./basic_and_faq_usages/enqueue_trial.py), which is useful when you would like to force certain parameters to be sampled.
> 2. [Manually provide trials with sampler](./faq/enqueue_trial.py), which is useful when you would like to force certain parameters to be sampled.
>
> 3. [Callback to control the termination criterion of study](./basic_and_faq_usages/max_trials_callback.py), which is useful when you would like to define your own termination criterion other than `n_trials` or `timeout`.
> 3. [Callback to control the termination criterion of study](./faq/max_trials_callback.py), which is useful when you would like to define your own termination criterion other than `n_trials` or `timeout`.
## Examples for Diverse Problem Setups

Expand All @@ -43,9 +43,9 @@ Here are the URLs to the example codeblocks to the corresponding setups.
<details open>
<summary>Simple Black-box Optimization</summary>

* [Quadratic Function](./basic_and_faq_usages/quadratic_simple.py)
* [Quadratic Multi-Objective Function](./basic_and_faq_usages/quadratic_simple_multi_objective.py)
* [Quadratic Function with Constraints](./basic_and_faq_usages/quadratic_simple_constraint.py)
* [Quadratic Function](./basic/quadratic.py)
* [Quadratic Multi-Objective Function](./basic/quadratic_multi_objective.py)
* [Quadratic Function with Constraints](./basic/quadratic_constraint.py)
</details>

<details open>
Expand Down Expand Up @@ -93,7 +93,7 @@ If you are looking for an example of reinforcement learning, please take a look

The following example demonstrates how to implement pruning logic with Optuna.

* [Simple pruning (scikit-learn)](./basic_and_faq_usages/simple_pruning.py)
* [Simple pruning (scikit-learn)](./basic/pruning.py)

In addition, integration modules are available for the following libraries, providing simpler interfaces to utilize pruning.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions basic/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
optuna
scikit-learn>=0.19.0
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c9452c8

Please sign in to comment.