loaders module

create_integrator_args(config=None)[source]

Create the full hierarchy of arguments for an integrator, including an instantiated optimizer

Parameters

config (dictionary-like, optional) – Full configuration dictionary for the Integrator function. If none is provided, the default configuration is used.

Returns

keyword dictionary ready to be provided as **kwargs to the Integrator function

Return type

obj:dict

get_default_integrator_config()[source]

Get a copy of the full default text-based integrator config

The default configuration file is situated in utils/config/integrator_config.yaml

get_optim_from_config(config=None)[source]

Get an optimizer object from a config dictionary

Parameters

config (dictionary-like, optional) – dictionary-like object with the following structure: { “optim_cls”: <optim class name within torch.optim>, “optim_config”: <dictionary defining the key-word argument parameters for instantiating that class> } If no argument is given, the default configuration is used (utils/config/optim_config.yaml)

Returns

a pre-filled optimizer constructor that only needs to be fed the model parameters.

Return type

function

Notes

This function does not instantiate the optimize object, it wraps its constructor with functools.partial to pre-fill the optimizer settings with the provided value. Given a model, one then needs to call the output on model.parameters()