MCPcopy Create free account
hub / github.com/geekcomputers/Python / __init__

Method __init__

ML/src/python/neuralforge/nn/convolution.py:206–215  ·  view source on GitHub ↗
(self, in_channels, out_channels, dilation_rates=[1, 2, 4, 8])

Source from the content-addressed store, hash-verified

204
205class DilatedConvBlock(nn.Module):
206 def __init__(self, in_channels, out_channels, dilation_rates=[1, 2, 4, 8]):
207 super().__init__()
208 self.convs = nn.ModuleList([
209 nn.Sequential(
210 nn.Conv2d(in_channels, out_channels // len(dilation_rates), 3, padding=d, dilation=d),
211 nn.BatchNorm2d(out_channels // len(dilation_rates)),
212 nn.ReLU(inplace=True)
213 )
214 for d in dilation_rates
215 ])
216
217 def forward(self, x):
218 return torch.cat([conv(x) for conv in self.convs], dim=1)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected