Solved by KFrank in post #2 
              
              
                Hello Arman! 

The function version of binary_cross_entropy (as distinct from the 
class (function object) version, BCELoss), supports a fine-grained, 
per-individual-element-of-each-sample weight argument. 
So, using this, you could weight the loss contribution of each frame 
separately, and, in pa…