Last active
July 20, 2022 12:56
-
-
Save AlessandroMondin/8cbc49ce59ed523fee19a5cb0932d1e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CNNBlock(nn.Module): | |
def __init__(self, | |
in_channels, | |
out_channels, | |
kernel_size=3, | |
stride=1, | |
padding=0): | |
super(CNNBlock, self).__init__() | |
self.seq_block = nn.Sequential( | |
nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, bias=False), | |
nn.BatchNorm2d(out_channels), | |
nn.ReLU(inplace=True) | |
) | |
def forward(self, x): | |
x = self.seq_block(x) | |
return x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment