get_model

hybrid_learning.experimentation.model_registry.model_registry.get_model(model_key, config, layer_infos=None, check_layer_infos=True)[source]

Return the result of a model builder previously registered via register_model.

Parameters
  • model_key (str) – registered key

  • layer_infos (Optional[Iterable[str]]) – iterable of layer IDs the model should feature

  • check_layer_infos (bool) – whether to validate layer_infos

  • config (Dict[str, Any]) – the config dict to hand over to the model builder

Raises
  • ValueError – if the built model is no torch model or layer_infos is unset while check_layer_infos is True

  • AssertionError – if check_layer_infos and one of the entries in layer_infos is not a valid layer identifier of the built model.

Returns

the built model

Return type

Module