@Paul changed arguments of predict method. One has to pass the topology of the neural network. Added maxGradientSize parameter so that the training can stop when local minimum is reached even if there is still high cost.