Skip to content

Commit

Permalink
fix for giannisnik#6
Browse files Browse the repository at this point in the history
Accuracy = 0 as a result of recent PyTorch changes. See here for info: pytorch/pytorch#5411
  • Loading branch information
robd2 committed Sep 14, 2018
1 parent 18deed2 commit 05acfc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kcnn/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def main():

criterion = nn.CrossEntropyLoss()

evaluation = lambda output, target: torch.sum(output.eq(target)) / target.size()[0]
evaluation = lambda output, target: float (torch.sum(output.eq(target))) / float (target.size()[0])

lr = args.lr
lr_step = (args.lr-args.lr*args.lr_decay)/(args.epochs*args.schedule[1] - args.epochs*args.schedule[0])
Expand Down

0 comments on commit 05acfc8

Please sign in to comment.