Skip to content

Commit c4e6230

Browse files
committed
forgot the only act func, now fixed
1 parent ef463fe commit c4e6230

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ def __init__(self, hidden_units, dropout_rate): # wried, why fusion X 2?
1111

1212
self.conv1 = torch.nn.Conv1d(hidden_units, hidden_units, kernel_size=1)
1313
self.dropout1 = torch.nn.Dropout(p=dropout_rate)
14+
self.relu = torch.nn.ReLU()
1415
self.conv2 = torch.nn.Conv1d(hidden_units, hidden_units, kernel_size=1)
1516
self.dropout2 = torch.nn.Dropout(p=dropout_rate)
1617

1718
def forward(self, inputs):
18-
outputs = self.dropout2(self.conv2(self.dropout1(self.conv1(inputs.transpose(-1, -2)))))
19+
outputs = self.dropout2(self.conv2(self.relu(self.dropout1(self.conv1(inputs.transpose(-1, -2))))))
1920
outputs = outputs.transpose(-1, -2) # as Conv1D requires (N, C, Length)
2021
outputs += inputs
2122
return outputs

0 commit comments

Comments
 (0)