bitorch.models.resnet_e.SpecificResnetE¶
- class bitorch.models.resnet_e.SpecificResnetE(classes: int, channels: list)[source]¶
Superclass for ResNet models
Methods
builds feature and output layers
forwards the input tensor through the resnet modules
builds the given layers with the specified block.
builds a layer by stacking blocks in a sequential models.
Attributes
- __init__(classes: int, channels: list) None [source]¶
builds feature and output layers
- Parameters:
classes (int) – number of output classes
channels (list) – the channels used in the net
- forward(x: Tensor) Tensor [source]¶
forwards the input tensor through the resnet modules
- Parameters:
x (torch.Tensor) – input tensor
- Returns:
forwarded tensor
- Return type:
torch.Tensor
- make_feature_layers(layers: list, channels: list) List[Module] [source]¶
builds the given layers with the specified block.
- Parameters:
layers (list) – the number of blocks each layer shall consist of
channels (list) – the channels
- Returns:
[description]
- Return type:
nn.Sequential
- make_layer(layers: int, in_channels: int, out_channels: int, stride: int) Sequential [source]¶
builds a layer by stacking blocks in a sequential models.
- Parameters:
layers (int) – the number of blocks to stack
in_channels (int) – the input channels of this layer
out_channels (int) – the output channels of this layer
stride (int) – the stride to be used in the convolution layers
- Returns:
the model containing the building blocks
- Return type:
nn.Sequential