Skip to content

Commit f35b5c9

Browse files
committed
fix test
1 parent 34d500c commit f35b5c9

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,5 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
result

ik_estimation.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,10 @@ def train(manager, args, model, device, train_loader):
6161
def test(args, model, device, data, target):
6262
model.eval()
6363
test_loss = 0
64-
correct = 0
6564
data, target = data.to(device), target.to(device)
6665
output = model(data)
67-
test_loss += (output - target).norm()
66+
test_loss += (output - target).norm().item()
6867
ppe.reporting.report({"val/loss": test_loss})
69-
pred = output.argmax(dim=1, keepdim=True)
70-
correct += pred.eq(target.view_as(pred)).sum().item()
71-
ppe.reporting.report({"val/acc": correct / len(data)})
7268

7369

7470
def main():
@@ -115,7 +111,6 @@ def main():
115111
"train/loss",
116112
"lr",
117113
"val/loss",
118-
"val/acc",
119114
]
120115
),
121116
]

0 commit comments

Comments
 (0)