Skip to content

Commit

Permalink
fix textCNN shaope comments typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuhuishishishi committed May 24, 2020
1 parent cb4881e commit fc48317
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 2-1.TextCNN/TextCNN-Torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self):
self.Bias = nn.Parameter(0.1 * torch.ones([num_classes])).type(dtype)

def forward(self, X):
embedded_chars = self.W[X] # [batch_size, sequence_length, sequence_length]
embedded_chars = self.W[X] # [batch_size, sequence_length, embedding_size]
embedded_chars = embedded_chars.unsqueeze(1) # add channel(=1) [batch, channel(=1), sequence_length, embedding_size]

pooled_outputs = []
Expand Down Expand Up @@ -96,4 +96,4 @@ def forward(self, X):
if predict[0][0] == 0:
print(test_text,"is Bad Mean...")
else:
print(test_text,"is Good Mean!!")
print(test_text,"is Good Mean!!")

0 comments on commit fc48317

Please sign in to comment.