(self, n_inputs, n_outputs, kernel_size, stride, dilation, padding, dropout=0.2)
| 55 | |
| 56 | class _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) |
nothing calls this directly
no test coverage detected