MCPcopy Index your code
hub / github.com/geekcomputers/Python / __init__

Method __init__

ML/src/python/neuralforge/nn/layers.py:99–109  ·  view source on GitHub ↗
(self, in_channels, growth_rate, drop_rate=0.0)

Source from the content-addressed store, hash-verified

97
98class DenseLayer(nn.Module):
99 def __init__(self, in_channels, growth_rate, drop_rate=0.0):
100 super().__init__()
101 self.bn1 = nn.BatchNorm2d(in_channels)
102 self.relu1 = nn.ReLU(inplace=True)
103 self.conv1 = nn.Conv2d(in_channels, growth_rate * 4, kernel_size=1, bias=False)
104
105 self.bn2 = nn.BatchNorm2d(growth_rate * 4)
106 self.relu2 = nn.ReLU(inplace=True)
107 self.conv2 = nn.Conv2d(growth_rate * 4, growth_rate, kernel_size=3, padding=1, bias=False)
108
109 self.dropout = nn.Dropout2d(drop_rate) if drop_rate > 0 else nn.Identity()
110
111 def forward(self, x):
112 out = self.conv1(self.relu1(self.bn1(x)))

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected