We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c65331 commit ff32018Copy full SHA for ff32018
05-cnn-pytorch/cnn-activation.py
@@ -29,7 +29,7 @@ def forward(self, words, return_activations=False):
29
# Do max pooling
30
h = h.max(dim=2)[0] # 1 x num_filters
31
h = self.relu(h)
32
- features = h.squeeze()
+ features = h.squeeze(0)
33
out = self.projection_layer(h) # size(out) = 1 x ntags
34
if return_activations:
35
return out, activations.data.cpu().numpy(), features.data.cpu().numpy()
0 commit comments