change the class name to listloss and add constructor for neuralnet