NRCan / geo-deep-learning

Deep learning applied to georeferenced datasets
https://geo-deep-learning.readthedocs.io/en/latest/
MIT License
150 stars 49 forks source link

multiclass loss computation error for validation and test #493

Closed FatemehEsfahani closed 1 year ago

FatemehEsfahani commented 1 year ago

This line in the evaluation function of training pipeline gives error for multiclass loss calculation for losses such as cross entropy. It should change to loss = criterion(outputs, labels) if num_classes > 1 else criterion(outputs, labels.unsqueeze(1).float()) The same way as it is computed in the training function.