train.py -> function check_accuracy -> accuracy formula is wrong
Closed this issue · 2 comments
MarkusKoenig73 commented
need to fix this way:
acc = float(num_correct) / num_samples / ( preds.size(1)*preds.size(2))
logging.info('number of samples %d, accuracy (perc.) (%.2f)' % ( num_samples, 100 * acc))
yangsiyu007 commented
Thank you Markus. In the refactored version I'll change it to
accuracy = (y == preds).float().mean()
, averaging over all samples in the batch and all pixels. I'll merge the refactored version (currently on branch batchai
) in the coming weeks.
yangsiyu007 commented
Merged.