yes that definition is not that great i'll try and replace it with a better one when i have time also i think that loss function in this sense is defined differently