Skip to content

Instantly share code, notes, and snippets.

@seanbenhur
Created November 9, 2020 11:23
Show Gist options
  • Save seanbenhur/42244f837f485c093618cc0e6727beb0 to your computer and use it in GitHub Desktop.
Save seanbenhur/42244f837f485c093618cc0e6727beb0 to your computer and use it in GitHub Desktop.
class conv_block(nn.Module):
def __init__(self, in_channels, out_channels, **kwargs):
super(conv_block, self).__init__()
self.relu = nn.ReLU()
self.conv = nn.Conv2d(in_channels, out_channels, **kwargs)
self.batchnorm = nn.BatchNorm2d(out_channels)
def forward(self, x):
return self.relu(self.batchnorm(self.conv(x)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment