pyto:

Still with L1Loss and reduction=‘sum’, and summing all losses of one epoch, then dividing them by (‘number of training or validation patches’ times ‘number of voxels per patch’) gives me a loss twice as high for training than validation in the beginning. Is this problematic? It is becoming better fast though (similar values for training and validation).


If you are accumulating the training loss for the complete epoch and calculate the average at the end of each epoch, the training loss might be higher, since your model was trained during the epoch.
E.g. the first batch might yield a training loss of 100, while the last batch yields 10. While the validation loss would be calculated using the “trained” model, the training loss would be the average of the complete epoch.
To verify it, you could recalculate the training loss after each epoch and compare it to the validation loss.