Skip to content

Commit daf6c2f

Browse files
authored
Merge pull request #92 from automl/development
Version 1.1.3
2 parents 1851126 + 64e4e9e commit daf6c2f

Some content is hidden

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

50 files changed

+6759
-22912
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Version 1.1.3
2+
3+
## Bug-Fixes
4+
- Fix seaborn style name (#82).
5+
- Remove potential sources of nondeterminism in evaluators by not setting seeds randomly (#75).
6+
- Exchange SMAC log examples to fix issue with PDP (#54).
7+
- Fix error when requesting more than 10 colors in a plot (36 colors available now).
8+
19
# Version 1.1.2
210

311
## Bug-Fixes

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# are usually completed in github actions.
33

44
SHELL := /bin/bash
5-
VERSION := 1.1.2
5+
VERSION := 1.1.3
66

77
NAME := DeepCAVE
88
PACKAGE_NAME := deepcave

deepcave/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Source Code": "https://github.com/automl/deepcave",
1818
}
1919
copyright = f"Copyright {datetime.date.today().strftime('%Y')}, {author}"
20-
version = "1.1.2"
20+
version = "1.1.3"
2121

2222
_exec_file = sys.argv[0]
2323
_exec_files = ["server.py", "worker.py", "sphinx-build"]

deepcave/evaluators/epm/fanova_forest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(
3030
instance_features: Optional[np.ndarray] = None,
3131
pca_components: Optional[int] = 2,
3232
cutoffs: Tuple[float, float] = (-np.inf, np.inf),
33-
seed: Optional[int] = None,
33+
seed: int = 0,
3434
):
3535
super().__init__(
3636
configspace=configspace,

deepcave/evaluators/epm/random_forest.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(
5656
instance_features: Optional[np.ndarray] = None,
5757
pca_components: Optional[int] = 2,
5858
log_y: bool = False,
59-
seed: Optional[int] = None,
59+
seed: int = 0,
6060
):
6161
self.cs = configspace
6262
self.log_y = log_y
@@ -295,8 +295,6 @@ def _train(self, X: np.ndarray, Y: np.ndarray) -> None:
295295
# Now we can start to prepare the data for the pyrfr
296296
data = self._get_data_container(X, Y.flatten())
297297
seed = self.seed
298-
if seed is None:
299-
seed = int(random() * 9999)
300298

301299
rng = regression.default_random_engine(seed)
302300

deepcave/evaluators/fanova.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def calculate(
3030
objectives: Optional[Union[Objective, List[Objective]]] = None,
3131
budget: Optional[Union[int, float]] = None,
3232
n_trees: int = 16,
33-
seed: Optional[int] = None,
33+
seed: int = 0,
3434
) -> None:
3535
"""
3636
Get the data wrt budget and trains the forest on the encoded data.
@@ -47,8 +47,8 @@ def calculate(
4747
Considered budget. By default None. If None, the highest budget is chosen.
4848
n_trees : int, optional
4949
How many trees should be used. By default 16.
50-
seed : Optional[int], optional
51-
Random seed. By default None.
50+
seed : int
51+
Random seed. By default 0.
5252
"""
5353
if objectives is None:
5454
objectives = self.run.get_objectives()

deepcave/evaluators/lpi.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def calculate(
3030
budget: Optional[Union[int, float]] = None,
3131
continous_neighbors: int = 500,
3232
n_trees: int = 10,
33-
seed: Optional[int] = None,
33+
seed: int = 0,
3434
) -> None:
3535
"""
3636
Prepares the data and trains a RandomForest model.
@@ -56,9 +56,6 @@ def calculate(
5656
self.default = self.cs.get_default_configuration()
5757
self.incumbent_array = self.incumbent.get_array()
5858

59-
# Set the seed
60-
if seed is None:
61-
seed = int(random() * 9999)
6259
self.seed = seed
6360
self.rs = np.random.RandomState(seed)
6461

deepcave/utils/styled_plot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class StyledPlot:
2525
"""
2626

2727
def __init__(self):
28-
plt.style.use("seaborn")
28+
plt.style.use("seaborn-v0_8")
2929

3030
# Set MatPlotLib defaults
3131
if find_executable("latex"):

deepcave/utils/styled_plotty.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ def hex_to_rgb(hex_string: str) -> Tuple[int, int, int]:
6969

7070
def get_color(id_: int, alpha: float = 1) -> Union[str, Tuple[float, float, float, float]]:
7171
"""
72-
Currently (Plotly version 5.3.1) there are 10 possible colors.
72+
Using Plotly palette for the first 10 ids and Alphabet palette for the next 26, currently 36 colors are possible.
7373
"""
74-
color = px.colors.qualitative.Plotly[id_]
74+
if id_ < 10:
75+
color = px.colors.qualitative.Plotly[id_]
76+
else:
77+
color = px.colors.qualitative.Alphabet[id_ - 10]
7578

7679
r, g, b = hex_to_rgb(color)
7780
return f"rgba({r}, {g}, {b}, {alpha})"
+19-81
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,40 @@
11
{
22
"hyperparameters": [
33
{
4-
"name": "activation",
5-
"type": "categorical",
6-
"choices": [
7-
"logistic",
8-
"tanh",
9-
"relu"
10-
],
11-
"default": "tanh",
12-
"probabilities": null
13-
},
14-
{
15-
"name": "n_layer",
16-
"type": "uniform_int",
17-
"log": false,
18-
"lower": 1,
19-
"upper": 5,
20-
"default": 1,
21-
"q": null
4+
"name": "alpha",
5+
"type": "uniform_float",
6+
"log": true,
7+
"lower": 1e-08,
8+
"upper": 1.0,
9+
"default": 0.001
2210
},
2311
{
24-
"name": "n_neurons",
12+
"name": "batch_size",
2513
"type": "uniform_int",
2614
"log": true,
27-
"lower": 8,
28-
"upper": 1024,
29-
"default": 10,
30-
"q": null
31-
},
32-
{
33-
"name": "solver",
34-
"type": "categorical",
35-
"choices": [
36-
"lbfgs",
37-
"sgd",
38-
"adam"
39-
],
40-
"default": "adam",
41-
"probabilities": null
15+
"lower": 4,
16+
"upper": 256,
17+
"default": 32
4218
},
4319
{
44-
"name": "batch_size",
20+
"name": "depth",
4521
"type": "uniform_int",
4622
"log": false,
47-
"lower": 30,
48-
"upper": 300,
49-
"default": 200,
50-
"q": null
51-
},
52-
{
53-
"name": "learning_rate",
54-
"type": "categorical",
55-
"choices": [
56-
"constant",
57-
"invscaling",
58-
"adaptive"
59-
],
60-
"default": "constant",
61-
"probabilities": null
23+
"lower": 1,
24+
"upper": 3,
25+
"default": 3
6226
},
6327
{
6428
"name": "learning_rate_init",
6529
"type": "uniform_float",
6630
"log": true,
67-
"lower": 0.0001,
31+
"lower": 1e-05,
6832
"upper": 1.0,
69-
"default": 0.001,
70-
"q": null
71-
}
72-
],
73-
"conditions": [
74-
{
75-
"child": "batch_size",
76-
"parent": "solver",
77-
"type": "IN",
78-
"values": [
79-
"sgd",
80-
"adam"
81-
]
82-
},
83-
{
84-
"child": "learning_rate",
85-
"parent": "solver",
86-
"type": "EQ",
87-
"value": "sgd"
88-
},
89-
{
90-
"child": "learning_rate_init",
91-
"parent": "solver",
92-
"type": "IN",
93-
"values": [
94-
"sgd",
95-
"adam"
96-
]
33+
"default": 0.001
9734
}
9835
],
36+
"conditions": [],
9937
"forbiddens": [],
100-
"python_module_version": "0.4.19",
101-
"json_format_version": 0.2
38+
"python_module_version": "0.6.1",
39+
"json_format_version": 0.4
10240
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
alpha real [1e-08, 1.0] [0.001]log
2+
batch_size integer [4, 256] [32]log
3+
depth integer [1, 3] [3]
4+
learning_rate_init real [1e-05, 1.0] [0.001]log

0 commit comments

Comments
 (0)