myogestic.utils.config.Registry.register_model#

Registry.register_model(name, model_class, is_classifier, save_function, load_function, train_function, predict_function, changeable_parameters=None, unchangeable_parameters=None, requires_temporal_preservation=False, feature_window_size=None)[source]#

Register a model in the registry.

The model name must be unique.

Parameters:
  • name (str) – The name of the model.

  • model_class (type) – The class of the model.

  • is_classifier (bool) – Whether the model is a classifier.

  • save_function (callable) – The function to save the model.

  • load_function (callable) – The function to load the model.

  • train_function (callable) – The function to train the model.

  • predict_function (callable) – The function to make predictions with the model.

  • changeable_parameters (dict of str to ChangeableParameter, optional) – A dictionary of changeable parameters for the model. Default is None.

  • unchangeable_parameters (dict of str to UnchangeableParameter, optional) – A dictionary of unchangeable parameters for the model. Default is None.

  • requires_temporal_preservation (bool, optional) – Whether the model requires temporal preservation in features. Default is False. Models like RaulNet with CNN layers need multiple temporal samples, so features should use smaller window sizes to preserve time dimension.

  • feature_window_size (int, optional) – The window size to use for feature extraction. Default is None, which uses the full buffer size. For models requiring temporal preservation, this should be smaller than the buffer size (e.g., 120 for RaulNet with buffer of 360).

Raises:

ValueError – If the model is already registered.

Return type:

None