Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate basic and faq directories #277

Merged
merged 4 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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](./basic/enqueue_trial.py), which is useful when you would like to force certain parameters to be sampled.
kAIto47802 marked this conversation as resolved.
Show resolved Hide resolved
>
> 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](./basic/max_trials_callback.py), which is useful when you would like to define your own termination criterion other than `n_trials` or `timeout`.
kAIto47802 marked this conversation as resolved.
Show resolved Hide resolved

## 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.
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.