ctlearn_optimizer.bayesian_gp

Module Contents

ctlearn_optimizer.bayesian_gp.skopt_space(hyper_to_opt)[source]

Create space of hyperparameters for the gaussian processes optimizer.

This function creates the space of hyperparameter following skopt syntax.

Parameters

hyper_to_opt (dict) – dictionary containing the configuration of the hyperparameters to optimize. This dictionary must follow the next syntax:

hyper_to_opt = {'hyperparam_1': {'type': ...,
                                 'range: ...,
                                 'step': ...},
                'hyperparam_2': {'type': ...,
                                 'range: ...,
                                 'step': ...},
                ...
                }

See the oficial documentation for more details.

Returns

list – space of hyperparameters following the syntax required by the gaussian processes optimization algorithm.

Example:

hyper_top_opt = {
    'cnn_rnn_dropout':{
        'type': 'uniform',
        'range': [0,1]},
    'optimizer_type':{
        'type': 'choice',,
        'range': ['Adadelta', 'Adam', 'RMSProp', 'SGD']},
    'base_learning_rate':{
        'type': 'loguniform',
        'range': [-5, 0]},
    'layer1_filters':{
        'type': 'quniform',
        'range': [16, 64],
        'step': 1}}
Raises

KeyError – if type is other than uniform, quniform, loguniform or choice.