MCPcopy Create free account
hub / github.com/AtlasAnalyticsLab/AdaFisher / Bottleneck

Class Bottleneck

Image_Classification/src/models/densenet_cifar.py:9–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9class 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
27class Transition(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected