Can you help me to explain how loss is defined? I'm sorry I tried my best but couldn't find it in the code.