ctlearn_optimizer.bayesian_tpe

Module Contents

ctlearn_optimizer.bayesian_tpe.hyperopt_space(hyper_to_opt)[source]

Create space of hyperparameters for the tree parzen estimators optimizer.

This function creates the space of hyperparameter following hyperopt 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

dict – space of hyperparameters following the syntax required by the tree parzen estimators optimization algorithm.

Example:

hyper_top_opt = {
    'cnn_rnn_dropout':{
        'type': 'uniform',
        'range': [0,1]},
    'optimizer_type': {
        'type': 'choice',
        'range': ['Adadelta', 'Adam', 'RMSProp', 'SGD']},
    'number_of_layers':{
        'type': 'conditional',
        'range': {
            'value': 1,
            'cond_params':{
                'layer1_kernel':{
                    'type': 'quniform',
                    'range': [2, 10],
                    'step': 1},
                'base_learning_rate':{
                    'type': 'loguniform',
                    'range': [-5, 0]} }}}}