Skip to content

Commit 0497625

Browse files
committed
rename label to target in Vanilla
1 parent f82071a commit 0497625

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dassl/engine/dg/vanilla.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ class Vanilla(TrainerX):
1212
"""
1313

1414
def forward_backward(self, batch):
15-
input, label = self.parse_batch_train(batch)
15+
input, target = self.parse_batch_train(batch)
1616
output = self.model(input)
17-
loss = F.cross_entropy(output, label)
17+
loss = F.cross_entropy(output, target)
1818
self.model_backward_and_update(loss)
1919

2020
loss_summary = {
2121
"loss": loss.item(),
22-
"acc": compute_accuracy(output, label)[0].item(),
22+
"acc": compute_accuracy(output, target)[0].item(),
2323
}
2424

2525
if (self.batch_idx + 1) == self.num_batches:
@@ -29,7 +29,7 @@ def forward_backward(self, batch):
2929

3030
def parse_batch_train(self, batch):
3131
input = batch["img"]
32-
label = batch["label"]
32+
target = batch["label"]
3333
input = input.to(self.device)
34-
label = label.to(self.device)
35-
return input, label
34+
target = target.to(self.device)
35+
return input, target

0 commit comments

Comments
 (0)