Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resnet_binary.py Bottleneck Class Issue #27

Open
EmrahErden opened this issue Jan 15, 2021 · 0 comments
Open

resnet_binary.py Bottleneck Class Issue #27

EmrahErden opened this issue Jan 15, 2021 · 0 comments

Comments

@EmrahErden
Copy link

First of all, please note that: I'm not really good at coding, especially with python. Hence I'm probably making some mistakes.

I have some issues with the Bottleneck class. Could you please check these out? According to the class initializer (in resnet_binary.py file):

    def __init__(self, inplanes, planes, stride=1, downsample=None):
        super(Bottleneck, self).__init__()
        self.conv1 = BinarizeConv2d(inplanes, planes, kernel_size=1, bias=False)
        self.bn1 = nn.BatchNorm2d(planes)
        self.conv2 = BinarizeConv2d(planes, planes, kernel_size=3, stride=stride,
                               padding=1, bias=False)
        self.bn2 = nn.BatchNorm2d(planes)
        self.conv3 = BinarizeConv2d(planes, planes * 4, kernel_size=1, bias=False)
        self.bn3 = nn.BatchNorm2d(planes * 4)
        self.tanh = nn.Hardtanh(inplace=True)
        self.downsample = downsample
        self.stride = stride

I can't see any defined variables, self.do_bntan (line 103) & self.tanh2 (line 105). Both of these were defined in BasicBlock class, but Bottleneck is not the super class of it. And I can't find any connection between these 2 classes. Hence can't figure out how these variables used, starting from line 103

Thank you for your help and attention

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant