Implement lib/*-loss.rb