Last active
June 29, 2019 05:24
-
-
Save mukulkhanna/86feacfbdbbc4ad841adac0e00e4de75 to your computer and use it in GitHub Desktop.
DenseNet transition block from https://github.com/gpleiss/efficient_densenet_pytorch/blob/master/models/densenet.py
This file contains 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 _Transition(nn.Sequential): | |
def __init__(self, num_input_features, num_output_features): | |
super(_Transition, self).__init__() | |
self.add_module('norm', nn.BatchNorm2d(num_input_features)) | |
self.add_module('relu', nn.ReLU(inplace=True)) | |
self.add_module('conv', nn.Conv2d(num_input_features, num_output_features, | |
kernel_size=1, stride=1, bias=False)) | |
self.add_module('pool', nn.AvgPool2d(kernel_size=2, stride=2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment