Model
pamiq_core.model.InferenceModel ¶
Bases: ABC
Base interface class for model to infer in InferenceThread.
Needed for multi-thread training and inference in parallel.
infer
abstractmethod
¶
Perform inference using a model.
PARAMETER | DESCRIPTION |
---|---|
*args
|
Positional arguments required for inference.
TYPE:
|
**kwds
|
Keyword arguments required for inference.
TYPE:
|
Returns: Any: The result of the inference.
Source code in src/pamiq_core/model/interface.py
__call__ ¶
Perform inference using a model.
PARAMETER | DESCRIPTION |
---|---|
*args
|
Positional arguments required for inference.
TYPE:
|
**kwds
|
Keyword arguments required for inference.
TYPE:
|
Returns: Any: The result of the inference.
Source code in src/pamiq_core/model/interface.py
pamiq_core.model.TrainingModel ¶
Bases: ABC
, PersistentStateMixin
Base interface class to train model in TrainingThread.
Needed for multi-thread training and inference in parallel.
Initialize the TrainingModel.
PARAMETER | DESCRIPTION |
---|---|
has_inference_model
|
Whether to have inference model.
TYPE:
|
inference_thread_only
|
Whether it is an inference thread only.
TYPE:
|
Source code in src/pamiq_core/model/interface.py
forward
abstractmethod
¶
Forward path of model.
PARAMETER | DESCRIPTION |
---|---|
*args
|
Positional arguments required for forward path.
TYPE:
|
**kwds
|
Keyword arguments required for forward path.
TYPE:
|
Returns: Result of forward path of the model.
Source code in src/pamiq_core/model/interface.py
__call__ ¶
sync ¶
Synchronizes parameters of training model to self._inference_model if needed.
sync_impl
abstractmethod
¶
Copies params of training model to self._inference_model if needed.
PARAMETER | DESCRIPTION |
---|---|
inference_model
|
InferenceModel to sync.
TYPE:
|