Skip to content

Commit

Permalink
Merge pull request #92 from automl/development
Browse files Browse the repository at this point in the history
Version 1.1.3
  • Loading branch information
sarah-segel authored Nov 8, 2023
2 parents 1851126 + 64e4e9e commit daf6c2f
Show file tree
Hide file tree
Showing 50 changed files with 6,759 additions and 22,912 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Version 1.1.3

## Bug-Fixes
- Fix seaborn style name (#82).
- Remove potential sources of nondeterminism in evaluators by not setting seeds randomly (#75).
- Exchange SMAC log examples to fix issue with PDP (#54).
- Fix error when requesting more than 10 colors in a plot (36 colors available now).

# Version 1.1.2

## Bug-Fixes
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# are usually completed in github actions.

SHELL := /bin/bash
VERSION := 1.1.2
VERSION := 1.1.3

NAME := DeepCAVE
PACKAGE_NAME := deepcave
Expand Down
2 changes: 1 addition & 1 deletion deepcave/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Source Code": "https://github.com/automl/deepcave",
}
copyright = f"Copyright {datetime.date.today().strftime('%Y')}, {author}"
version = "1.1.2"
version = "1.1.3"

_exec_file = sys.argv[0]
_exec_files = ["server.py", "worker.py", "sphinx-build"]
Expand Down
2 changes: 1 addition & 1 deletion deepcave/evaluators/epm/fanova_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(
instance_features: Optional[np.ndarray] = None,
pca_components: Optional[int] = 2,
cutoffs: Tuple[float, float] = (-np.inf, np.inf),
seed: Optional[int] = None,
seed: int = 0,
):
super().__init__(
configspace=configspace,
Expand Down
4 changes: 1 addition & 3 deletions deepcave/evaluators/epm/random_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(
instance_features: Optional[np.ndarray] = None,
pca_components: Optional[int] = 2,
log_y: bool = False,
seed: Optional[int] = None,
seed: int = 0,
):
self.cs = configspace
self.log_y = log_y
Expand Down Expand Up @@ -295,8 +295,6 @@ def _train(self, X: np.ndarray, Y: np.ndarray) -> None:
# Now we can start to prepare the data for the pyrfr
data = self._get_data_container(X, Y.flatten())
seed = self.seed
if seed is None:
seed = int(random() * 9999)

rng = regression.default_random_engine(seed)

Expand Down
6 changes: 3 additions & 3 deletions deepcave/evaluators/fanova.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def calculate(
objectives: Optional[Union[Objective, List[Objective]]] = None,
budget: Optional[Union[int, float]] = None,
n_trees: int = 16,
seed: Optional[int] = None,
seed: int = 0,
) -> None:
"""
Get the data wrt budget and trains the forest on the encoded data.
Expand All @@ -47,8 +47,8 @@ def calculate(
Considered budget. By default None. If None, the highest budget is chosen.
n_trees : int, optional
How many trees should be used. By default 16.
seed : Optional[int], optional
Random seed. By default None.
seed : int
Random seed. By default 0.
"""
if objectives is None:
objectives = self.run.get_objectives()
Expand Down
5 changes: 1 addition & 4 deletions deepcave/evaluators/lpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def calculate(
budget: Optional[Union[int, float]] = None,
continous_neighbors: int = 500,
n_trees: int = 10,
seed: Optional[int] = None,
seed: int = 0,
) -> None:
"""
Prepares the data and trains a RandomForest model.
Expand All @@ -56,9 +56,6 @@ def calculate(
self.default = self.cs.get_default_configuration()
self.incumbent_array = self.incumbent.get_array()

# Set the seed
if seed is None:
seed = int(random() * 9999)
self.seed = seed
self.rs = np.random.RandomState(seed)

Expand Down
2 changes: 1 addition & 1 deletion deepcave/utils/styled_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class StyledPlot:
"""

def __init__(self):
plt.style.use("seaborn")
plt.style.use("seaborn-v0_8")

# Set MatPlotLib defaults
if find_executable("latex"):
Expand Down
7 changes: 5 additions & 2 deletions deepcave/utils/styled_plotty.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ def hex_to_rgb(hex_string: str) -> Tuple[int, int, int]:

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

r, g, b = hex_to_rgb(color)
return f"rgba({r}, {g}, {b}, {alpha})"
Expand Down
100 changes: 19 additions & 81 deletions logs/SMAC3v1/mlp/run_1/configspace.json
Original file line number Diff line number Diff line change
@@ -1,102 +1,40 @@
{
"hyperparameters": [
{
"name": "activation",
"type": "categorical",
"choices": [
"logistic",
"tanh",
"relu"
],
"default": "tanh",
"probabilities": null
},
{
"name": "n_layer",
"type": "uniform_int",
"log": false,
"lower": 1,
"upper": 5,
"default": 1,
"q": null
"name": "alpha",
"type": "uniform_float",
"log": true,
"lower": 1e-08,
"upper": 1.0,
"default": 0.001
},
{
"name": "n_neurons",
"name": "batch_size",
"type": "uniform_int",
"log": true,
"lower": 8,
"upper": 1024,
"default": 10,
"q": null
},
{
"name": "solver",
"type": "categorical",
"choices": [
"lbfgs",
"sgd",
"adam"
],
"default": "adam",
"probabilities": null
"lower": 4,
"upper": 256,
"default": 32
},
{
"name": "batch_size",
"name": "depth",
"type": "uniform_int",
"log": false,
"lower": 30,
"upper": 300,
"default": 200,
"q": null
},
{
"name": "learning_rate",
"type": "categorical",
"choices": [
"constant",
"invscaling",
"adaptive"
],
"default": "constant",
"probabilities": null
"lower": 1,
"upper": 3,
"default": 3
},
{
"name": "learning_rate_init",
"type": "uniform_float",
"log": true,
"lower": 0.0001,
"lower": 1e-05,
"upper": 1.0,
"default": 0.001,
"q": null
}
],
"conditions": [
{
"child": "batch_size",
"parent": "solver",
"type": "IN",
"values": [
"sgd",
"adam"
]
},
{
"child": "learning_rate",
"parent": "solver",
"type": "EQ",
"value": "sgd"
},
{
"child": "learning_rate_init",
"parent": "solver",
"type": "IN",
"values": [
"sgd",
"adam"
]
"default": 0.001
}
],
"conditions": [],
"forbiddens": [],
"python_module_version": "0.4.19",
"json_format_version": 0.2
"python_module_version": "0.6.1",
"json_format_version": 0.4
}
4 changes: 4 additions & 0 deletions logs/SMAC3v1/mlp/run_1/configspace.pcs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
alpha real [1e-08, 1.0] [0.001]log
batch_size integer [4, 256] [32]log
depth integer [1, 3] [3]
learning_rate_init real [1e-05, 1.0] [0.001]log
Loading

0 comments on commit daf6c2f

Please sign in to comment.