Skip to content

Commit 86c323c

Browse files
renesassPhMuellerdwoiwode
authored
Version 0.2 (#17)
## Runs - Groups were replaced by `GroupedRun`. Hence, a group can be used as a normal run (`AbstractRun`). - Groups are only created if the runs are compatible (via function `check_equality`). ## Plugins - Integrated Parallel Coordinates. - Configurations Cube and Parallel Coordinates show the real config values and not the encoded anymore. - Changed plugin interfaces (check_run_compatibility, check_runs_compatibility, load_inputs, load_dependency_inputs). - Enhanced native group selection drastically. - Added icons to the plugins. - Removed ICE for now as too many bugs were found. ## Others - Added typehints. - Added tests for caches, basic layouts and other utils. - Added tools (mypy, flake8 and blake) - Performance increase in `general` as a folder is only transformed to a run if selected. ## Known Bugs - fANOVA does not work if the configspace includes constants. Co-authored-by: PhMueller <[email protected]> Co-authored-by: dwoiwode <[email protected]> Co-authored-by: Dominik Woiwode <[email protected]>
1 parent ff6b367 commit 86c323c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+6930
-3362
lines changed

.DS_Store

-6 KB
Binary file not shown.

.flake8

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
show-source = True
3+
max-line-length = 100
4+
extend-exclude =
5+
venv
6+
.venv
7+
build
8+
extend-ignore =
9+
# No whitespace before ':' in [x : y]
10+
E203
11+
# No lambdas — too strict
12+
E731

.github/workflows/pytest.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PyTest
2+
on: [ push ]
3+
jobs:
4+
pytest:
5+
name: PyTest
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Add conda to system path
10+
run: |
11+
# $CONDA is an environment variable pointing to the root of the miniconda directory
12+
echo $CONDA/bin >> $GITHUB_PATH
13+
- name: Setup Python 3.9
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.9
17+
- name: Install dependencies
18+
run: |
19+
conda env update --file environment.yml --name base
20+
pip install .
21+
pip install .[dev]
22+
- name: Run pytest
23+
run: pytest tests

.gitignore

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@ build/*
22
*cache*
33
!*cache.py
44
!*caches.py
5-
docs/*
65
__pycache__
76
*.rdb
87
examples/logs/SMAC
98
examples/logs/BOHB
109
smac3-output*
1110
.DS_Store
12-
pending
13-
__init__.pyc
11+
__init__.pyc
12+
examples/logs*
13+
examples/*
14+
!examples/logs/DeepCAVE
15+
!examples/record
16+
examples/record/_*.py
17+
*.sh
18+
!run.sh
19+
.vscode
20+
*.egg-info
21+
docs/apidoc
22+
docs/html
23+
docs/pages/examples

.pre-commit-config.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
repos:
2+
3+
- repo: https://github.com/pycqa/isort
4+
rev: 5.10.1
5+
hooks:
6+
- id: isort
7+
name: isort imports deepcave
8+
files: deepcave/.*
9+
args: [--check]
10+
11+
- id: isort
12+
name: isort imports test
13+
files: test/.*
14+
args: [--check]
15+
16+
- repo: https://github.com/ambv/black
17+
rev: 21.12b0
18+
hooks:
19+
- id: black
20+
name: black formatter deepcave
21+
files: deepcave/.*
22+
args: [--check]
23+
24+
- id: black
25+
name: black formatter test
26+
files: test/.*
27+
args: [--check]
28+
29+
- id: black
30+
name: black formatter examples
31+
files: examples/.*
32+
args: [--check]
33+
34+
# This is disabled as most modules fail this
35+
- repo: https://github.com/pycqa/pydocstyle
36+
rev: 6.1.1
37+
hooks:
38+
- id: pydocstyle
39+
files: DISABLED # deepcave/.*
40+
always_run: false
41+
additional_dependencies: ["toml"] # Needed to parse pyproject.toml
42+
43+
- repo: https://github.com/pre-commit/mirrors-mypy
44+
rev: v0.930
45+
hooks:
46+
- id: mypy
47+
name: mypy deepcave
48+
files: deepcave/.*
49+
50+
- repo: https://gitlab.com/pycqa/flake8
51+
rev: 4.0.1
52+
hooks:
53+
- id: flake8
54+
name: flake8 deepcave
55+
files: deepcave/.*
56+
57+
- id: flake8
58+
name: flake8 test
59+
files: test/.*

CHANGELOG.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
# 0.2
2+
3+
## Runs
4+
- Groups were replaced by `GroupedRun`. Hence, a group can be used as a normal run (`AbstractRun`).
5+
- Groups are only created if the runs are compatible (via function `check_equality`).
6+
7+
## Plugins
8+
- Integrated Parallel Coordinates.
9+
- Configurations Cube and Parallel Coordinates show the real config values and not
10+
the encoded anymore.
11+
- Changed plugin interfaces (check_run_compatibility, check_runs_compatibility,
12+
load_inputs, load_dependency_inputs).
13+
- Enhanced native group selection drastically.
14+
- Added icons to the plugins.
15+
- Removed ICE for now as too many bugs were found.
16+
17+
## Others
18+
- Added typehints.
19+
- Added tests for caches, basic layouts and other utils.
20+
- Added tools (mypy, flake8 and blake)
21+
- Performance increase in `general` as a folder is only transformed to a run if selected.
22+
23+
## Known Bugs
24+
- fANOVA does not work if the configspace includes constants.
25+
26+
27+
# 0.1.1
28+
29+
## Plugins
30+
31+
- ICE/PDP: Added uncertainties
32+
- fANOVA: Works with no budgets now
33+
34+
## Others
35+
36+
- Installable via pip
37+
38+
139
# 0.1
240

341
## Features
@@ -8,7 +46,6 @@
846
- Recorder: Record your runs and save them directly as DeepCAVE files.
947
- Matplotlib mode: Alternatively, plugins can output Matplotlib rendered plots.
1048

11-
1249
## Plugins
1350

1451
- StaticPlugin: Uses queue to process the result.
@@ -21,9 +58,8 @@
2158
- Individual Conditional Expectation / Partial Dependency Plots: Shows how individual instances behave.
2259
- fANOVA: Shows Hyperparameter Importance.
2360

24-
2561
## Converters
2662

2763
- DeepCAVE
2864
- SMAC
29-
- BOHB (Beta)
65+
- BOHB (Beta)

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# syntax=docker/dockerfile:1
2+
3+
FROM continuumio/miniconda3
4+
5+
# Install linux dependencies
6+
RUN apt-get update -y
7+
RUN apt install -y build-essential
8+
RUN apt-get install -y swig
9+
RUN apt-get install -y redis-server
10+
11+
# Copy files
12+
COPY . /DeepCAVE
13+
WORKDIR /DeepCAVE
14+
15+
RUN conda update conda -y
16+
17+
# Create new environment
18+
RUN conda env create -f environment.yml
19+
20+
# Make RUN commands use the new environment:
21+
SHELL ["conda", "run", "-n", "DeepCAVE", "/bin/bash", "-c"]
22+
23+
# Install DeepCAVE
24+
RUN pip install .

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include requirements.txt
2+
include extras_require.json
3+
include loggin.yml
4+
include start.sh

Makefile

Lines changed: 98 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,100 @@
1-
install:
2-
pip install -r requirements.txt
1+
# NOTE: Used on linux, limited support outside of Linux
2+
#
3+
# A simple makefile to help with small tasks related to development of deepcave
4+
# These have been configured to only really run short tasks. Longer form tasks
5+
# are usually completed in github actions.
36

7+
.PHONY: help install-dev check format pre-commit clean clean-build build publish test
8+
9+
help:
10+
@echo "Makefile deepcave"
11+
@echo "* install-dev to install all dev requirements and install pre-commit"
12+
@echo "* check to check the source code for issues"
13+
@echo "* format to format the code with black and isort"
14+
@echo "* pre-commit to run the pre-commit check"
15+
@echo "* clean to clean the dist and doc build files"
16+
@echo "* build to build a dist"
17+
@echo "* publish to help publish the current branch to pypi"
18+
@echo "* tests to run the tests"
19+
20+
PYTHON ?= python
21+
CYTHON ?= cython
22+
PYTEST ?= python -m pytest
23+
CTAGS ?= ctags
24+
PIP ?= python -m pip
25+
MAKE ?= make
26+
BLACK ?= black
27+
ISORT ?= isort
28+
PYDOCSTYLE ?= pydocstyle
29+
MYPY ?= mypy
30+
PRECOMMIT ?= pre-commit
31+
FLAKE8 ?= flake8
32+
33+
DIR := ${CURDIR}
34+
DIST := ${CURDIR}/dist
35+
36+
install-dev:
37+
$(PIP) install -e ".[dev]"
38+
pre-commit install
39+
40+
check-black:
41+
$(BLACK) deepcave examples tests --check || :
42+
43+
check-isort:
44+
$(ISORT) deepcave tests --check || :
45+
46+
check-pydocstyle:
47+
$(PYDOCSTYLE) deepcave || :
48+
49+
check-mypy:
50+
$(MYPY) deepcave || :
51+
52+
check-flake8:
53+
$(FLAKE8) deepcave || :
54+
$(FLAKE8) tests || :
55+
56+
# pydocstyle does not have easy ignore rules, instead, we include as they are covered
57+
check: check-black check-isort check-mypy check-flake8 # check-pydocstyle
58+
59+
pre-commit:
60+
$(PRECOMMIT) run --all-files
61+
62+
format-black:
63+
$(BLACK) deepcave tests examples
64+
65+
format-isort:
66+
$(ISORT) deepcave tests
67+
68+
format: format-black format-isort
69+
70+
clean-build:
71+
$(PYTHON) setup.py clean
72+
rm -rf ${DIST}
73+
74+
# Clean up any builds in ./dist as well as doc
475
clean:
5-
rm -rf cache
76+
clean-build
77+
rm -rf cache
78+
79+
# Build a distribution in ./dist
80+
build:
81+
$(PYTHON) setup.py bdist
82+
83+
# Publish to testpypi
84+
# Will echo the commands to actually publish to be run to publish to actual PyPi
85+
# This is done to prevent accidental publishing but provide the same conveniences
86+
publish: clean-build build
87+
$(PIP) install twine
88+
$(PYTHON) -m twine upload --repository testpypi ${DIST}/*
89+
@echo
90+
@echo "Test with the following line:"
91+
@echo "pip install --index-url https://test.pypi.org/simple/ auto-sklearn"
92+
@echo
93+
@echo "Once you have decided it works, publish to actual pypi with"
94+
@echo "python -m twine upload dist/*"
95+
96+
tests:
97+
$(PYTEST) tests
98+
99+
100+

README.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,25 @@ DeepCAVE has two main contributions:
77

88
## Installation
99

10+
First, make sure you have
11+
[swig](https://www.dev2qa.com/how-to-install-swig-on-macos-linux-and-windows/) and
12+
[redis-server](https://flaviocopes.com/redis-installation/) installed on your
13+
computer.
14+
15+
If you are on an Non-Intel Mac you have to add
1016
```
11-
git clone https://github.com/automl/DeepCAVE.git
12-
cd DeepCAVE
13-
conda create -n DeepCAVE python=3.9
14-
make install
17+
export DISABLE_SPRING=true
18+
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
1519
```
20+
to your ```~/.bash_profile``` to enable multi-processing.
1621

17-
If you want to use DeepCAVE in a different directory set your PYTHONPATH:
22+
Afterwards, follow the instructions:
1823
```
19-
export PYTHONPATH=$(pwd)
24+
git clone https://github.com/automl/DeepCAVE.git
25+
cd DeepCAVE
26+
conda env create -f environment.yml
27+
conda activate DeepCAVE
28+
pip install .
2029
```
2130

2231

@@ -26,15 +35,18 @@ In the following, a minimal example is given to show the simplicity yet powerful
2635

2736
```
2837
import ConfigSpace as CS
29-
from deep_cave import Recorder
38+
from deep_cave import Recorder, Objective
3039
3140
3241
configspace = CS.ConfigurationSpace(seed=0)
3342
alpha = CS.hyperparameters.UniformFloatHyperparameter(
3443
name='alpha', lower=0, upper=1)
3544
configspace.add_hyperparameter(alpha)
3645
37-
with Recorder(configspace, objectives=["accuracy", "mse"]) as r:
46+
accuracy = Objective("accuracy", lower=0, upper=1, optimize="upper")
47+
mse = Objective("mse", lower=0)
48+
49+
with Recorder(configspace, objectives=[accuracy, mse]) as r:
3850
for config in configspace.sample_configuration(100):
3951
for budget in [20, 40, 60]:
4052
r.start(config, budget)
@@ -45,8 +57,16 @@ with Recorder(configspace, objectives=["accuracy", "mse"]) as r:
4557
4658
## Visualizing and Evaluating
4759
48-
The webserver as well as the queue/workers can be started by running ``` ./run.sh ```.
60+
The webserver as well as the queue/workers can be started by running
61+
```
62+
deepcave --start
63+
```
64+
or
65+
```
66+
./start.sh
67+
```
68+
4969
Visit `http://127.0.0.1:8050/` to get started.
5070
51-
![interface](interface.png)
71+
![interface](media/interface.png)
5272

0 commit comments

Comments
 (0)