Skip to content

Commit

Permalink
Merge pull request #39 from automl/development
Browse files Browse the repository at this point in the history
Get branch up to date with development
  • Loading branch information
Bronzila committed Jul 11, 2023
2 parents dfad80d + 54ce41c commit 25d2716
Show file tree
Hide file tree
Showing 6 changed files with 452 additions and 100 deletions.
88 changes: 11 additions & 77 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]

steps:
Expand Down Expand Up @@ -73,6 +73,15 @@ jobs:
run: |
pytest ${{ env.pytest-args }} ${{ env.test-dir }}
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'

- name: Remove Coverage file
uses: JesseTG/[email protected]
with:
path: coverage.lcov

- name: Check for files left behind by test
run: |
before="${{ steps.status-before.outputs.BEFORE }}"
Expand All @@ -82,79 +91,4 @@ jobs:
echo "git status from after: $after"
echo "Not all generated files have been deleted!"
exit 1
fi
# Testing with conda
conda-tests:
name: conda-${{ matrix.python-version }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0} # Default to using bash on all and load (-l) .bashrc which miniconda uses

strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Conda install
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- name: Install ${{ env.package-name }}
run: |
python -V
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install -e ".${{ env.extra-requires }}"
- name: Tests
run: |
pytest ${{ env.pytest-args }} ${{ env.test-dir }}
# Testing a dist install
dist-test:
name: dist-${{ matrix.python-version }}-${{ matrix.os }}

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash

strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Create sdist
id: sdist
run: |
python -m pip install --upgrade pip
python setup.py sdist
echo "${{env.package-name}}"
echo "sdist_name=$(ls -t dist/${{ env.package-name }}-*.tar.gz | head -n 1)" >> $GITHUB_ENV
- name: Install ${{ env.package-name }}
run: |
python -m pip install ${{ env.sdist_name }}${{ env.extra-requires }}
- name: Tests
run: |
pytest ${{ env.pytest-args }} ${{ env.test-dir }}
fi
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# DEHB: Evolutionary Hyperband for Scalable, Robust and Efficient Hyperparameter Optimization

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Tests](https://github.com/automl/DEHB/actions/workflows/pytest.yml/badge.svg)](https://github.com/automl/DEHB/actions/workflows/pytest.yml)
[![Coverage Status](https://coveralls.io/repos/github/automl/DEHB/badge.svg)](https://coveralls.io/github/automl/DEHB)
[![PyPI](https://img.shields.io/pypi/v/dehb)](https://pypi.org/project/dehb/)
[![Static Badge](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20-blue)](https://pypi.org/project/dehb/)
### Installation
```bash
# from pypi
Expand All @@ -16,6 +20,7 @@ pip install -e DEHB # -e stands for editable, lets you modify the code and reru
* [01 - Using DEHB to optimize 4 hyperparameters of a Scikit-learn's Random Forest on a classification dataset](examples/01_Optimizing_RandomForest_using_DEHB.ipynb)
* [02 - Optimizing Scikit-learn's Random Forest without using ConfigSpace to represent the hyperparameter space](examples/02_using%20DEHB_without_ConfigSpace.ipynb)
* [03 - Hyperparameter Optimization for MNIST in PyTorch](examples/03_pytorch_mnist_hpo.py)
* [04 - A generic template to use MODEHB for multi-objectives Hyperparameter Optimization](examples/04_mo_pytorch_mnist_hpo.py)

To run PyTorch example: (*note additional requirements*)
```bash
Expand Down Expand Up @@ -81,7 +86,8 @@ python examples/03_pytorch_mnist_hpo.py --min_budget 1 --max_budget 3 \
--verbose --runtime 60 --scheduler_file dask_dump/scheduler.json
```


### Running DEHB to optimize multiple objectives
To run multi-objective optimization we require 1 extra parameter mo_strategy: we provide MO-optimization using Non-dominated sorted (NDS) with crowding distance (NSGA-II) and NDS with eps-net(EPSNET). Find 04_mo_pytorch_mnist_hpo.py example to help you to get started

### DEHB Hyperparameters

Expand Down Expand Up @@ -122,3 +128,10 @@ represents the *mutation* strategy while `bin` represents the *binomial crossove
editor = {Z. Zhou},
year = {2021}
}
@online{Awad-arXiv-2023,
title = {MO-DEHB: Evolutionary-based Hyperband for Multi-Objective Optimization},
author = {Noor Awad and Ayushi Sharma and Frank Hutter},
year = {2023},
keywords = {}
}
Loading

0 comments on commit 25d2716

Please sign in to comment.