KnowIt.interpret.interpreter#
The “KIInterpreter” class is the parent (root) class that is to be inherited by all other model interpretability modules.
The function of the “KIInterpreter” class is to store the datamodule and initialize the Pytorch model for use by its descendant classes. As such, it is a direct link to Knowit’s other modules. It is agnostic to the user’s choice of interpretability method.
Classes#
Root class to be inherited by all interpretability classes. |
Module Contents#
- class KnowIt.interpret.interpreter.KIInterpreter(model, model_params, datamodule, device, path_to_ckpt)#
Root class to be inherited by all interpretability classes.
The class stores the user’s parameters and initializes a trained PyTorch model from checkpoint.
- Parameters:
model (
type
) – The PyTorch model architecture class.model_params (
dict
) – The dictionary needed to initialize the model.datamodule (
type
) – The Knowit datamodule for the experiment.device (
str
) – The device on which to run the model.path_to_ckpt (
str
) – The path to a trained model’s checkpoint file.
- Variables:
model (
Module
) – The initialized PyTorch model loaded with weights from the checkpoint.datamodule (
type
) – The Knowit datamodule for the experiment.device (
torch.device
) – The device on which the model is run.