Skip to content

Commit

Permalink
Version 1.0.1 (#759)
Browse files Browse the repository at this point in the history
Added licenses
  • Loading branch information
René Sass authored Aug 6, 2021
1 parent 3db542c commit 407b7c9
Show file tree
Hide file tree
Showing 116 changed files with 356 additions and 101 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.0.1

## Minor Changes
* Added license information to every file.
* Fixed a display bug inside usage recommendation.

# 1.0.0

The main purpose of this release is to be synchronized with our upcoming paper.
Expand Down
3 changes: 3 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import smac
from smac.utils.io.cmd_reader import CMDReader

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
31 changes: 15 additions & 16 deletions doc/usage_recomendation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@ Usage Recommendation
To make the usage of *SMAC* as easy as possible, we provide several facades designed for these different use cases. Here we give some general recommendations on
when to use which facade. These recommendations are based on our experience and technical limitations and is by far not intended to be complete:

+-----------------------+----------------------+-------------------------+-------------------------+
| | SMAC4BB | SMAC4HPO (Hyper- | SMAC4AC (Algorithm- |
| | (Black-Box) | parameter Optimization) | Configuration) |
+=======================+======================+=========================+=========================+
| # parameter | low | low/medium/high | low/medium/high |
+-----------------------+----------------------+-------------------------+-------------------------+
| categorical parameter | yes | supported | supported |
+-----------------------+----------------------+-------------------------+-------------------------+
| conditional parameter | yes | supported | supported |
+-----------------------+----------------------+-------------------------+-------------------------+
| instances | no | None or CV-folds | yes |
+-----------------------+----------------------+-------------------------+-------------------------+
| stochasticity | no | supported | supported |
+-----------------------+----------------------+-------------------------+-------------------------+
| objective | any (except runtime) | e.g. validation loss | e.g. runtime or quality |
+-----------------------+----------------------+-------------------------+-------------------------+
+-----------------------+----------------------+-----------------------------------------+-----------------------------------+
| | SMAC4BB (Black-Box) | SMAC4HPO (Hyperparameter Optimization) | SMAC4AC (Algorithm Configuration) |
+=======================+======================+=========================================+===================================+
| # parameter | low | low/medium/high | low/medium/high |
+-----------------------+----------------------+-----------------------------------------+-----------------------------------+
| categorical parameter | yes | supported | supported |
+-----------------------+----------------------+-----------------------------------------+-----------------------------------+
| conditional parameter | yes | supported | supported |
+-----------------------+----------------------+-----------------------------------------+-----------------------------------+
| instances | no | None or CV-folds | yes |
+-----------------------+----------------------+-----------------------------------------+-----------------------------------+
| stochasticity | no | supported | supported |
+-----------------------+----------------------+-----------------------------------------+-----------------------------------+
| objective | any (except runtime) | e.g. validation loss | e.g. runtime or quality |
+-----------------------+----------------------+-----------------------------------------+-----------------------------------+

Some examples of typical use cases:

Expand Down
3 changes: 3 additions & 0 deletions examples/SMAC4BB/SMAC4BB_rosenbrock_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# Import SMAC-utilities
from smac.scenario.scenario import Scenario

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


def rosenbrock_2d(x):
""" The 2 dimensional Rosenbrock function as a toy model
Expand Down
3 changes: 3 additions & 0 deletions examples/SMAC4HPO/SMAC4HPO_acq_rosenbrock_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
# Import SMAC-utilities
from smac.scenario.scenario import Scenario

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


def rosenbrock_2d(x):
""" The 2 dimensional Rosenbrock function as a toy model
Expand Down
3 changes: 3 additions & 0 deletions examples/SMAC4HPO/SMAC4HPO_gradientboosting_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
from smac.facade.smac_hpo_facade import SMAC4HPO
from smac.scenario.scenario import Scenario

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


# load data and split it into training and test dataset
X, y = make_hastie_10_2(random_state=0)
Expand Down
3 changes: 3 additions & 0 deletions examples/SMAC4HPO/SMAC4HPO_rosenbrock_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# Import SMAC-utilities
from smac.scenario.scenario import Scenario

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


def rosenbrock_2d(x):
""" The 2 dimensional Rosenbrock function as a toy model
Expand Down
4 changes: 4 additions & 0 deletions examples/SMAC4HPO/SMAC4HPO_svm_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
# Import SMAC-utilities
from smac.scenario.scenario import Scenario

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


# We load the iris-dataset (a widely used benchmark)
iris = datasets.load_iris()

Expand Down
4 changes: 4 additions & 0 deletions examples/SMAC4MF/SMAC4MF_mlp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
from smac.facade.smac_mf_facade import SMAC4MF
from smac.scenario.scenario import Scenario

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


digits = load_digits()


Expand Down
4 changes: 4 additions & 0 deletions examples/SMAC4MF/SMAC4MF_sgd_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
# Import SMAC-utilities
from smac.scenario.scenario import Scenario

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


# We load the MNIST-dataset (a widely used benchmark) and split it into a list of binary datasets
digits = datasets.load_digits()
instances = [[str(a) + str(b)] for a, b in itertools.combinations(digits.target_names, 2)]
Expand Down
3 changes: 3 additions & 0 deletions examples/function_minimization/fmin_rosenbrock_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

from smac.facade.func_facade import fmin_smac

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


def rosenbrock_2d(x):
""" The 2 dimensional Rosenbrock function as a toy model
Expand Down
4 changes: 4 additions & 0 deletions examples/hyperband/hyperband_mlp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

import warnings

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


digits = load_digits()


Expand Down
4 changes: 4 additions & 0 deletions examples/parallel/fmin_rosenbrock_parallel_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
import os
import sys

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


# https://sphinx-gallery.github.io/stable/faq.html#why-is-file-not-defined-what-can-i-use
cwd = os.path.dirname(__file__) if '__file__' in globals() else os.getcwd()
sys.path.append(os.path.join(cwd))
Expand Down
3 changes: 3 additions & 0 deletions examples/parallel/mlp_from_cfg_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from sklearn.model_selection import cross_val_score, StratifiedKFold
from sklearn.neural_network import MLPClassifier

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


# A common function to be optimized by a Real valued Intensifier
digits = load_digits()
Expand Down
5 changes: 5 additions & 0 deletions examples/parallel/parallel_sh_mlp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

import os
import sys

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


# https://sphinx-gallery.github.io/stable/faq.html#why-is-file-not-defined-what-can-i-use
cwd = os.path.dirname(__file__) if '__file__' in globals() else os.getcwd()
sys.path.append(os.path.join(cwd))
Expand Down
4 changes: 4 additions & 0 deletions examples/parallel/rosenbrock_2d_delayed_func.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import time

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


# --------------------------------------------------------------
# When working with multiprocessing, we need to provide a pickable
# function and use __main__. Details can be found on:
Expand Down
3 changes: 3 additions & 0 deletions examples/quickstart/branin/branin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import numpy as np

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


def branin(x):
x1 = x[0]
Expand Down
4 changes: 4 additions & 0 deletions examples/quickstart/branin/branin_fmin_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
from branin import branin
from smac.facade.func_facade import fmin_smac

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


"""
Example for the use of fmin_smac, a basic SMAC-wrapper to optimize a
function.
Expand Down
4 changes: 4 additions & 0 deletions examples/quickstart/branin/cmdline_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

from branin import branin

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


"""
This is a wrapper used by SMAC to optimize parameters on the branin-function.
Expand Down
4 changes: 4 additions & 0 deletions examples/quickstart/branin/restore_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
from smac.stats.stats import Stats
from smac.utils.io.traj_logging import TrajLogger

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


"""
This file runs SMAC and then restores the run with an extended computation
budget. This will also work for SMAC runs that have crashed and are continued.
Expand Down
3 changes: 3 additions & 0 deletions examples/quickstart/spear_qcp/SMAC4AC_SH_spear_qcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
from smac.intensification.successive_halving import SuccessiveHalving
from smac.scenario.scenario import Scenario

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


if __name__ == '__main__':
scenario = Scenario('scenario.txt')
Expand Down
4 changes: 4 additions & 0 deletions scripts/smac-validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
from smac.utils.io.traj_logging import TrajLogger
from smac.utils.validate import Validator

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


if __name__ == "__main__":
parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter)
req_opts = parser.add_argument_group("Required Options")
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import os
from setuptools import setup

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


with open('requirements.txt') as fh:
requirements = [line.strip() for line in fh.readlines()]
Expand Down
2 changes: 2 additions & 0 deletions smac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from smac.utils import dependencies

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"
__version__ = '1.0.0'
__author__ = 'Marius Lindauer, Katharina Eggensperger, Matthias Feurer, André Biedenkapp, ' \
'Difan Deng, Carolin Benjamins, René Sass ' \
Expand Down
4 changes: 4 additions & 0 deletions smac/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
from smac.optimizer.smbo import SMBO
from smac.runhistory.runhistory import RunInfo, RunValue

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


"""Callbacks for SMAC.
Callbacks allow customizing the behavior of SMAC to ones needs. Currently, the list of implemented callbacks is
Expand Down
4 changes: 4 additions & 0 deletions smac/configspace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
from ConfigSpace.util import get_one_exchange_neighbourhood
from smac.configspace.util import convert_configurations_to_array

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


__all__ = ["ConfigurationSpace",
"Configuration",
"Constant",
Expand Down
4 changes: 3 additions & 1 deletion smac/configspace/util.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from typing import List

import numpy as np

from smac.configspace import Configuration

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


def convert_configurations_to_array(configs: List[Configuration]) -> np.ndarray:
"""Impute inactive hyperparameters in configurations with their default.
Expand Down
3 changes: 3 additions & 0 deletions smac/epm/base_gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
from sklearn.gaussian_process.kernels import Kernel, KernelOperator
from sklearn.gaussian_process import GaussianProcessRegressor

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


class BaseModel(AbstractEPM):

Expand Down
1 change: 0 additions & 1 deletion smac/epm/base_imputor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import numpy as np


__author__ = "Katharina Eggensperger"
__copyright__ = "Copyright 2015, ML4AAD"
__license__ = "3-clause BSD"
Expand Down
3 changes: 3 additions & 0 deletions smac/epm/base_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
ConfigurationSpace,
)

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


class BaseModel(AbstractEPM):

Expand Down
4 changes: 4 additions & 0 deletions smac/epm/gaussian_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
from sklearn.gaussian_process.kernels import Kernel
from sklearn.gaussian_process import GaussianProcessRegressor

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


logger = logging.getLogger(__name__)


Expand Down
4 changes: 4 additions & 0 deletions smac/epm/gaussian_process_mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
from sklearn.gaussian_process.kernels import Kernel
from sklearn.gaussian_process import GaussianProcessRegressor

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


logger = logging.getLogger(__name__)


Expand Down
3 changes: 3 additions & 0 deletions smac/epm/gp_base_prior.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

from smac.utils.constants import VERY_SMALL_NUMBER

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


class Prior(object):

Expand Down
5 changes: 4 additions & 1 deletion smac/epm/gp_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

from smac.epm.gp_base_prior import Prior

__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"


# This file contains almost no type annotations to simplify comparing it to the original scikit-learn version!


Expand Down Expand Up @@ -519,7 +523,6 @@ def _call(
eval_gradient: bool = False,
active: Optional[np.ndarray] = None,
) -> Union[np.ndarray, Tuple[np.ndarray, np.ndarray]]:

"""Return the kernel k(X, Y) and optionally its gradient.
Parameters
Expand Down
1 change: 0 additions & 1 deletion smac/epm/rf_with_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from smac.epm.base_rf import BaseModel
from smac.utils.constants import N_TREES, VERY_SMALL_NUMBER


__author__ = "Aaron Klein"
__copyright__ = "Copyright 2015, ML4AAD"
__license__ = "3-clause BSD"
Expand Down
Loading

0 comments on commit 407b7c9

Please sign in to comment.