MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / __init__

Method __init__

models/NHits.py:87–98  ·  view source on GitHub ↗
(self, num_inputs, num_channels, kernel_size=2, dropout=0.2)

Source from the content-addressed store, hash-verified

85
86class _TemporalConvNet(nn.Module):
87 def __init__(self, num_inputs, num_channels, kernel_size=2, dropout=0.2):
88 super(_TemporalConvNet, self).__init__()
89 layers = []
90 num_levels = len(num_channels)
91 for i in range(num_levels):
92 dilation_size = 2 ** i
93 in_channels = num_inputs if i == 0 else num_channels[i-1]
94 out_channels = num_channels[i]
95 layers += [_TemporalBlock2(in_channels, out_channels, kernel_size, stride=1, dilation=dilation_size,
96 padding=(kernel_size-1) * dilation_size, dropout=dropout)]
97
98 self.network = nn.Sequential(*layers)
99
100 def forward(self, x):
101 return self.network(x)

Callers

nothing calls this directly

Calls 2

_TemporalBlock2Class · 0.70
__init__Method · 0.45

Tested by

no test coverage detected