MCPcopy
hub / github.com/HobbitLong/SupContrast / _make_layer

Method _make_layer

networks/resnet_big.py:107–114  ·  view source on GitHub ↗
(self, block, planes, num_blocks, stride)

Source from the content-addressed store, hash-verified

105 nn.init.constant_(m.bn2.weight, 0)
106
107 def _make_layer(self, block, planes, num_blocks, stride):
108 strides = [stride] + [1] * (num_blocks - 1)
109 layers = []
110 for i in range(num_blocks):
111 stride = strides[i]
112 layers.append(block(self.in_planes, planes, stride))
113 self.in_planes = planes * block.expansion
114 return nn.Sequential(*layers)
115
116 def forward(self, x, layer=100):
117 out = F.relu(self.bn1(self.conv1(x)))

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected