deepr.cli package

Submodules

deepr.cli.main module

Main Entry Point for deepr commands.

Available commands:

deepr run job.json macros.json

deepr from_config_and_macros config.json macros.json

deepr download_config_and_macros_from_mlflow 12dk242jd http://mlflow.url

deepr add_macro config.json macros.json batch_size,learning_rate
deepr.cli.main.add_macro(config, macros, params, macro='params')[source]

Create new params macro, infer new references in config.

Look for keys in dictionaries of both macros and config that are in params, and for each param, store the existing value, replace it by a macro reference “$macro:param”, and finally add the new macro parameter to the macros.

The resulting updated config and macros are written in the a subdirectory of the config’s directory, with name “new”.

WARNING: This function is performing a lot of magic by automatically replacing values in both macros and config. It is highly recommended to manually inspect the resulting config.

Parameters:
  • config (str) – Path to config.json

  • macros (str) – Path to macros.json

  • params (Union[List[str], str]) – List of new parameters

  • macro (str, optional) – Name of the new macro

Raises:

ValueError – If any param in params has no match in either config and macros.

deepr.cli.main.download_config_and_macros_from_mlflow(run_id, tracking_uri=None, config='config_no_static.json', macros='macros_no_static.json', path_config='config.json', path_macros='macros.json')[source]

Download config and macros from MLFlow.

Parameters:
  • run_id (str) – MLFlow Run ID

  • tracking_uri (str, optional) – MLFlow tracking URI

  • config (str, optional) – Name of the config artifact

  • macros (str, optional) – Name of the macros artifact

  • path_config (str, optional) – Local path to file where to write the config

  • path_macros (str, optional) – Local path to file where to write the macros

deepr.cli.main.from_config_and_macros(config, macros=None)[source]

Instantiate object from config and macros.

Parameters:
  • config (str) – Path to json file or json string

  • macros (str, optional) – Path to json file or json string

Returns:

Defined by config

Return type:

Instance

deepr.cli.main.main()[source]

Main entry point

deepr.cli.main.run(job, macros=None)[source]

Instantiate job from job configs and macros and run.

Parameters:
  • job (str) – Path to json file or json string

  • macros (str, optional) – Path to json file or json string

Module contents