MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / __init__

Method __init__

models/nets/wrn.py:26–40  ·  view source on GitHub ↗
(self, in_planes, out_planes, stride, drop_rate=0.0, activate_before_residual=False)

Source from the content-addressed store, hash-verified

24
25class BasicBlock(nn.Module):
26 def __init__(self, in_planes, out_planes, stride, drop_rate=0.0, activate_before_residual=False):
27 super(BasicBlock, self).__init__()
28 self.bn1 = nn.BatchNorm2d(in_planes, momentum=0.001, eps=0.001)
29 self.relu1 = nn.LeakyReLU(negative_slope=0.1, inplace=False)
30 self.conv1 = nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
31 padding=1, bias=True)
32 self.bn2 = nn.BatchNorm2d(out_planes, momentum=0.001, eps=0.001)
33 self.relu2 = nn.LeakyReLU(negative_slope=0.1, inplace=False)
34 self.conv2 = nn.Conv2d(out_planes, out_planes, kernel_size=3, stride=1,
35 padding=1, bias=True)
36 self.drop_rate = drop_rate
37 self.equalInOut = (in_planes == out_planes)
38 self.convShortcut = (not self.equalInOut) and nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride,
39 padding=0, bias=True) or None
40 self.activate_before_residual = activate_before_residual
41
42 def forward(self, x):
43 if not self.equalInOut and self.activate_before_residual == True:

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected