Skip to content

Commit

Permalink
Merge pull request #7 from robd2/master
Browse files Browse the repository at this point in the history
fix for #6 Accuracy = 0 as a result of recent PyTorch changes. See here for info: pytorch/pytorch#5411
  • Loading branch information
giannisnik authored Feb 15, 2019
2 parents a63ef4b + 05acfc8 commit 740c682
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 740c682

Please sign in to comment.