you cannot do model.backward(input, target) whether in LuaTorch or PyTorch. LuaTorch’s actual interface is model.backward(input, gradients_wrt_output).
You need a loss function whether it is Lua or PyTorch to measure the distance between output and target