Skip to content

Commit 078911a

Browse files
committed
fix cbow bug
1 parent 2957663 commit 078911a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

06-Natural Language Process/bag-of-word.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def forward(self, x):
5050
if torch.cuda.is_available():
5151
model = model.cuda()
5252

53-
criterion = nn.CrossEntropyLoss()
53+
criterion = nn.NLLLoss()
5454
optimizer = optim.SGD(model.parameters(), lr=1e-3)
5555

5656
for epoch in range(100):

0 commit comments

Comments
 (0)