cleaning loss.py
regrouping yu functions