twhui/LiteFlowNet

How to calculate training loss

abrosua opened this issue · 3 comments

I'm currently trying to recreate the PyTorch version of LiteFlowNet for both the inference and training pipeline, and I have a question regarding the training loss calculation.

It's shown in the train prototxt that the L2 training losses are calculate at every level for each stage (M, S and R), thus resulting with 15 losses value.

How to calculate the training loss? Is it:
a.) the Sum product of all the 15 values (with their respective loss weight)
OR
b.) Calculate the mean loss value for each level (M, S and R), then calculate the sum of it (the 5 loss values from every level).
Or maybe by other method.

Thank you very much for your attention, best regards.

twhui commented

I am not so sure whether I fully understood your question. Are you asking how to compute the L2 losses or the total loss?

I'm asking for the total loss computation

twhui commented

Total loss = The weighted sum (using the respective loss weights as the training prototxt) of all the losses of each stage (M, S, R) at each level.