tmeasures.pytorch package
Subpackages
Submodules
tmeasures.pytorch.activations_iterator module
tmeasures.pytorch.activations_iterator_base module
tmeasures.pytorch.activations_transformer module
- class tmeasures.pytorch.activations_transformer.ActivationsTransformer(activation_shapes: [Tuple[int]], layer_names: [str], transformation_set: tm.TransformationSet, inverse: bool)[source]
Bases:
object
- get_transformations_set(shapes: [Tuple[int]], transformation_set: tm.TransformationSet, inverse: bool)[source]
tmeasures.pytorch.base module
tmeasures.pytorch.dataset2d module
- class tmeasures.pytorch.dataset2d.Dataset2D(*args, **kwds)[source]
Bases:
Dataset
- abstract property T
- abstract property len0
- abstract property len1
- class tmeasures.pytorch.dataset2d.STDataset(dataset: Dataset, transformations: PyTorchTransformationSet, device=device(type='cpu'))[source]
Bases:
Dataset2D
- class tmeasures.pytorch.dataset2d.SampleTransformationDataset(dataset: Dataset, transformations: PyTorchTransformationSet, device=device(type='cpu'))[source]
Bases:
STDataset
- property len0
- property len1
tmeasures.pytorch.goodfellow module
tmeasures.pytorch.layer_measures module
tmeasures.pytorch.measure_transformer module
tmeasures.pytorch.model module
- class tmeasures.pytorch.model.AutoActivationsModule(module: ~torch.nn.modules.module.Module, full_name=True, filter: ~typing.Callable = <function AutoActivationsModule.<lambda>>)[source]
Bases:
ActivationsModule
- training: bool
- class tmeasures.pytorch.model.FilteredActivationsModule(inner_model: ActivationsModule, activations_filter: Callable[[ActivationsModule, str], bool])[source]
Bases:
ActivationsModule
- eval()[source]
Sets the module in evaluation mode.
This has any effect only on certain modules. See documentations of particular modules for details of their behaviors in training/evaluation mode, if they are affected, e.g.
Dropout
,BatchNorm
, etc.This is equivalent with
self.train(False)
.See locally-disable-grad-doc for a comparison between .eval() and several similar mechanisms that may be confused with it.
- Returns:
Module: self
- forward()[source]
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
- tmeasures.pytorch.model.flatten_dict(d_or_val: Input, prefix='', sep='/', allow_repeated=False) dict[str, Any] [source]