![]() |
Belle II Software development
|
Class for the residual block layer. More...
Public Member Functions | |
__init__ (self, ninput, noutput, upsample=True) | |
Constructor to create a new residual block layer. | |
forward (self, x) | |
Function to perform a forward pass. | |
Public Attributes | |
upsample = upsample | |
Whether to double the height and width of input. | |
conv = None | |
Convolutional layer in the shortcut branch. | |
norm1 = nn.BatchNorm2d(ninput) | |
First batch normalization layer in the residual branch. | |
conv1 = nn.Conv2d(ninput, noutput, 3, 1, 1) | |
First convolutional layer in the residual branch. | |
norm2 = nn.BatchNorm2d(noutput) | |
Second batch normalization layer in the residual branch. | |
conv2 = nn.Conv2d(noutput, noutput, 3, 1, 1) | |
Second convolutional layer in the residual branch. | |
__init__ | ( | self, | |
ninput, | |||
noutput, | |||
upsample = True ) |
Constructor to create a new residual block layer.
Definition at line 24 of file resnet.py.
forward | ( | self, | |
x ) |
Function to perform a forward pass.
Compute the layer output for a given input.
Definition at line 39 of file resnet.py.
conv1 = nn.Conv2d(ninput, noutput, 3, 1, 1) |
conv2 = nn.Conv2d(noutput, noutput, 3, 1, 1) |
norm1 = nn.BatchNorm2d(ninput) |
norm2 = nn.BatchNorm2d(noutput) |
upsample = upsample |