(self, n_inputs, n_outputs, kernel_size, stride, dilation, padding, dropout=0.2)
| 69 | |
| 70 | class _TemporalBlock2(nn.Module): |
| 71 | def __init__(self, n_inputs, n_outputs, kernel_size, stride, dilation, padding, dropout=0.2): |
| 72 | super(_TemporalBlock2, self).__init__() |
| 73 | self.causalconv1 = CausalConv1d(in_channels=n_inputs, out_channels=n_outputs, |
| 74 | kernel_size=kernel_size, stride=stride, padding=padding, |
| 75 | dilation=dilation, activation='ReLU', with_weight_norm=True) |
| 76 | |
| 77 | self.causalconv2 = CausalConv1d(in_channels=n_outputs, out_channels=n_outputs, |
| 78 | kernel_size=kernel_size, stride=stride, padding=padding, |
| 79 | dilation=dilation, activation='ReLU', with_weight_norm=True) |
| 80 | |
| 81 | self.net = nn.Sequential(self.causalconv1, nn.Dropout(dropout), |
| 82 | self.causalconv2, nn.Dropout(dropout)) |
| 83 | |
| 84 | self.downsample = nn.Conv1d(n_inputs, n_outputs, 1) if n_inputs != n_outputs else None |
| 85 | self.relu = nn.ReLU() |
| 86 | self.init_weights() |
| 87 | |
| 88 | def init_weights(self): |
| 89 | self.causalconv1.conv.weight.data.normal_(0, 0.01) |
nothing calls this directly
no test coverage detected