extorch.nn.modules.auxiliary
- class extorch.nn.modules.auxiliary.AuxiliaryHead(in_channels: int, num_classes: int)[source]
Bases:
torch.nn.modules.module.Module
Auxiliary head for the classification task on CIFAR datasets.
- Parameters
in_channels (int) – Number of channels in the input feature.
num_classes (int) – Number of classes.
- Examples::
>>> import torch >>> input = torch.randn((10, 3, 32, 32)) >>> module = AuxiliaryHead(3, 10) >>> output = module(input)
- forward(input: torch.Tensor) torch.Tensor [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
- class extorch.nn.modules.auxiliary.AuxiliaryHeadImageNet(in_channels: int, num_classes: int)[source]
Bases:
torch.nn.modules.module.Module
Auxiliary head for the classification task on the ImageNet dataset.
- Parameters
in_channels (int) – Number of channels in the input feature.
num_classes (int) – Number of classes.
- Examples::
>>> import torch >>> input = torch.randn(10, 5, 32, 32) >>> module = AuxiliaryHeadImageNet(5, 10) >>> output = module(input)
- forward(input: torch.Tensor) torch.Tensor [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