-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hyper-parameter Tuning Support -- Optuna (#62)
* Common hyperparameter tuning interface #60 * Added Optuna support * Refactored backend to support split of fixed and tuneable parameters * Added black/isort * Handles usage pattern of drop-in argparser replacement where no configs (from cmd line or as input into ConfigArgBuilder) are passed thus falling back on all defaults or definitions from the command line. fix-up of all cmdline usage pattern. there were certain edge cases that were not getting caught correctly if it wasn't overriding an existing payload from a yaml file. #61 * Unit tests Signed-off-by: Nicholas Cilfone <nicholas.cilfone@fmr.com>
- Loading branch information
Showing
95 changed files
with
4,764 additions
and
1,661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: Pull request | ||
about: Create a pull request for merge | ||
|
||
--- | ||
|
||
## What does this PR do? | ||
E.g. Describe the added feature or what issue it fixes #(issue)... | ||
|
||
## Checklist | ||
- [ ] Did you adhere to [PEP-8](https://www.python.org/dev/peps/pep-0008/) standards? | ||
- [ ] Did you run black and isort prior to submitting your PR? | ||
- [ ] Does your PR pass all existing unit tests? | ||
- [ ] Did you add associated unit tests for any additional functionality? | ||
- [ ] Did you provide documentation ([Numpy Docstring format](https://numpydoc.readthedocs.io/en/latest/format.html#style-guide)) whenever possible, even for simple functions or classes? | ||
|
||
## Review | ||
Request will go to reviewers to approve for merge. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This workflow will run isort and black linters on PRs | ||
|
||
name: lint | ||
|
||
# on: workflow_dispatch | ||
on: | ||
pull_request: | ||
branches: [master] | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
run_lint: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('REQUIREMENTS.txt') }}-${{ hashFiles('./requirements/DEV_REQUIREMENTS.txt') }}-${{ hashFiles('./requirements/S3_REQUIREMENTS.txt') }} | ||
|
||
- name: Install dependencies and dev dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e . | ||
pip install -r ./requirements/DEV_REQUIREMENTS.txt | ||
pip install -r ./requirements/S3_REQUIREMENTS.txt | ||
- name: Run isort linter | ||
run: | | ||
isort --check . --skip="debug" --skip="versioneer.py" --skip="tests" --skip="_version.py" | ||
- name: Run black linter | ||
run: | | ||
black --check . --exclude="versioneer.py|_version.py|debug|tests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# This workflow will install Python dependencies, run S3 tests with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: pytest-tune | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('REQUIREMENTS.txt') }}-${{ hashFiles('./requirements/DEV_REQUIREMENTS.txt') }}-${{ hashFiles('./requirements/S3_REQUIREMENTS.txt') }}-${{ hashFiles('./requirements/TUNE_REQUIREMENTS.txt') }}-${{ hashFiles('./requirements/TEST_EXTRAS_REQUIREMENTS_REQUIREMENTS.txt') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e . | ||
pip install -r ./requirements/DEV_REQUIREMENTS.txt | ||
pip install -r ./requirements/S3_REQUIREMENTS.txt | ||
pip install -r ./requirements/TUNE_REQUIREMENTS.txt | ||
pip install -r ./requirements/TEST_EXTRAS_REQUIREMENTS.txt | ||
- name: Test with pytest | ||
run: | | ||
pytest tests/tune --cov=spock --cov-config=.coveragerc --junitxml=junit/test-results-tune-${{ matrix.python-version }}.xml --cov-report=xml --cov-report=html | ||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pytest-results-${{ matrix.python-version }} | ||
path: junit/test-results-${{ matrix.python-version }}.xml | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
attrs | ||
GitPython | ||
pyYAML | ||
toml | ||
pytomlpp | ||
pyYAML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Hyper-Parameter Tuning Support | ||
|
||
This series of docs will describe the basics of hyper-parameter support within `spock`. `spock` tries to be as hands-off | ||
as possible with the underlying backends that support hyper-parameter tuning and only provide a common and simplified | ||
interface to define hyper-parameter tuning runs. The rest is left up to the user to define and handle, thus to not | ||
handcuff the user into too simplified functionality. | ||
|
||
All examples can be found [here](https://github.com/fidelity/spock/blob/master/examples). | ||
|
||
### Installing | ||
|
||
Install `spock` with the extra hyper-parameter tuning related dependencies. | ||
|
||
```bash | ||
pip install spock-config[tune] | ||
``` | ||
|
||
### Supported Backends | ||
* [Optuna](https://optuna.readthedocs.io/en/stable/index.html) | ||
|
||
### WIP/Planned Backends | ||
* [Ax](https://ax.dev/) |
Oops, something went wrong.