MCPcopy Create free account
hub / github.com/M-Nauta/ProtoTree / __init__

Method __init__

features/resnet_features.py:34–45  ·  view source on GitHub ↗
(self, inplanes, planes, stride=1, downsample=None)

Source from the content-addressed store, hash-verified

32 num_layers = 2
33
34 def __init__(self, inplanes, planes, stride=1, downsample=None):
35 super(BasicBlock, self).__init__()
36 # only conv with possibly not 1 stride
37 self.conv1 = conv3x3(inplanes, planes, stride)
38 self.bn1 = nn.BatchNorm2d(planes)
39 self.relu = nn.ReLU(inplace=True)
40 self.conv2 = conv3x3(planes, planes)
41 self.bn2 = nn.BatchNorm2d(planes)
42
43 # if stride is not 1 then self.downsample cannot be None
44 self.downsample = downsample
45 self.stride = stride
46
47 def forward(self, x):
48 identity = x

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 1

conv3x3Function · 0.85

Tested by

no test coverage detected