| 7 | |
| 8 | |
| 9 | class Bottleneck(nn.Module): |
| 10 | def __init__(self, in_planes, growth_rate): |
| 11 | super(Bottleneck, self).__init__() |
| 12 | self.bn1 = nn.BatchNorm2d(in_planes) |
| 13 | self.conv1 = nn.Conv2d(in_planes, 4*growth_rate, |
| 14 | kernel_size=1, bias=False) |
| 15 | self.bn2 = nn.BatchNorm2d(4*growth_rate) |
| 16 | self.conv2 = nn.Conv2d(4*growth_rate, growth_rate, |
| 17 | kernel_size=3, padding=1, bias=False) |
| 18 | self.relu = nn.ReLU(inplace=False) |
| 19 | |
| 20 | def forward(self, x): |
| 21 | out = self.conv1(self.relu(self.bn1(x))) |
| 22 | out = self.conv2(self.relu(self.bn2(out))) |
| 23 | out = torch.cat([out, x], 1) |
| 24 | return out |
| 25 | |
| 26 | |
| 27 | class Transition(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected