Solved by guijun_ren in post #2 
              
              
                This problem has been resolved. 
I derived a bit and figured those two loss calculation approaches are essentially the same.