hxtorch.spiking.utils.model_mapper.MixinHXModelMapper
-
class
hxtorch.spiking.utils.model_mapper.
MixinHXModelMapper
Bases:
object
Mapper mixin to map snn models to hxtorch.spiking models
-
__init__
() Initialize self. See help(type(self)) for accurate signature.
Methods
map_from
(state_dict, mapping[, map_all])Map an SNN model with state dict state_dict to this model. :param state_dict: The state dict used to map from. :param mapping: The mapping from the keys of this model’s state dict to the keys in state_dict. :param map_all: A boolean value indicating if a state dict key is looked up in state_dict if not present in mapping. This allows to only define a mapping for some keys and load the others implicitly if the key names match. Defaults to true.
-
map_from
(state_dict: Any, mapping: Dict, map_all: bool = True) Map an SNN model with state dict state_dict to this model. :param state_dict: The state dict used to map from. :param mapping: The mapping from the keys of this model’s state dict to
the keys in state_dict.
- Parameters
map_all – A boolean value indicating if a state dict key is looked up in state_dict if not present in mapping. This allows to only define a mapping for some keys and load the others implicitly if the key names match. Defaults to true.
-