File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ class Vanilla(TrainerX):
12
12
"""
13
13
14
14
def forward_backward (self , batch ):
15
- input , label = self .parse_batch_train (batch )
15
+ input , target = self .parse_batch_train (batch )
16
16
output = self .model (input )
17
- loss = F .cross_entropy (output , label )
17
+ loss = F .cross_entropy (output , target )
18
18
self .model_backward_and_update (loss )
19
19
20
20
loss_summary = {
21
21
"loss" : loss .item (),
22
- "acc" : compute_accuracy (output , label )[0 ].item (),
22
+ "acc" : compute_accuracy (output , target )[0 ].item (),
23
23
}
24
24
25
25
if (self .batch_idx + 1 ) == self .num_batches :
@@ -29,7 +29,7 @@ def forward_backward(self, batch):
29
29
30
30
def parse_batch_train (self , batch ):
31
31
input = batch ["img" ]
32
- label = batch ["label" ]
32
+ target = batch ["label" ]
33
33
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
You can’t perform that action at this time.
0 commit comments