recbole.config.configurator

class recbole.config.configurator.Config(model=None, dataset=None, config_file_list=None, config_dict=None)[source]

Bases: object

Configurator module that load the defined parameters.

Configurator module will first load the default parameters from the fixed properties in RecBole and then load parameters from the external input.

External input supports three kind of forms: config file, command line and parameter dictionaries.

  • config file: It’s a file that record the parameters to be modified or added. It should be in yaml format, e.g. a config file is ‘example.yaml’, the content is:

    learning_rate: 0.001

    train_batch_size: 2048

  • command line: It should be in the format as ‘—learning_rate=0.001’

  • parameter dictionaries: It should be a dict, where the key is parameter name and the value is parameter value, e.g. config_dict = {‘learning_rate’: 0.001}

Configuration module allows the above three kind of external input format to be used together, the priority order is as following:

command line > parameter dictionaries > config file

e.g. If we set learning_rate=0.01 in config file, learning_rate=0.02 in command line, learning_rate=0.03 in parameter dictionaries.

Finally the learning_rate is equal to 0.02.

compatibility_settings()[source]