average_loss function

Average Loss