MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / _ASPPModule

Class _ASPPModule

open_loop_training/code/model_code/backbones/lss.py:20–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19
20class _ASPPModule(nn.Module):
21 def __init__(self, inplanes, planes, kernel_size, padding, dilation,
22 BatchNorm):
23 super(_ASPPModule, self).__init__()
24 self.atrous_conv = nn.Conv2d(inplanes,
25 planes,
26 kernel_size=kernel_size,
27 stride=1,
28 padding=padding,
29 dilation=dilation,
30 bias=False)
31 self.bn = BatchNorm(planes)
32 self.relu = nn.ReLU()
33 self._init_weight()
34
35 def forward(self, x):
36 x = self.atrous_conv(x)
37 x = self.bn(x)
38 return self.relu(x)
39
40 def _init_weight(self):
41 for m in self.modules():
42 if isinstance(m, nn.Conv2d):
43 torch.nn.init.kaiming_normal_(m.weight)
44 elif isinstance(m, nn.BatchNorm2d):
45 m.weight.data.fill_(1)
46 m.bias.data.zero_()
47
48
49class ASPP(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected