refactor LossFunctions to take advantage of Tmult -- transpose multiplication -- method