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

Method __init__

models/NHits.py:57–72  ·  view source on GitHub ↗
(self, n_inputs, n_outputs, kernel_size, stride, dilation, padding, dropout=0.2)

Source from the content-addressed store, hash-verified

55
56class _TemporalBlock2(nn.Module):
57 def __init__(self, n_inputs, n_outputs, kernel_size, stride, dilation, padding, dropout=0.2):
58 super(_TemporalBlock2, self).__init__()
59 self.causalconv1 = CausalConv1d(in_channels=n_inputs, out_channels=n_outputs,
60 kernel_size=kernel_size, stride=stride, padding=padding,
61 dilation=dilation, activation='ReLU', with_weight_norm=True)
62
63 self.causalconv2 = CausalConv1d(in_channels=n_outputs, out_channels=n_outputs,
64 kernel_size=kernel_size, stride=stride, padding=padding,
65 dilation=dilation, activation='ReLU', with_weight_norm=True)
66
67 self.net = nn.Sequential(self.causalconv1, nn.Dropout(dropout),
68 self.causalconv2, nn.Dropout(dropout))
69
70 self.downsample = nn.Conv1d(n_inputs, n_outputs, 1) if n_inputs != n_outputs else None
71 self.relu = nn.ReLU()
72 self.init_weights()
73
74 def init_weights(self):
75 self.causalconv1.conv.weight.data.normal_(0, 0.01)

Callers

nothing calls this directly

Calls 3

init_weightsMethod · 0.95
CausalConv1dClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected