You may need to put your model in training mode in the training loop. (I’m not sure if that’s the default or not.)
neural_net.train()

For evaluation/testing it should be set to evaluation mode.
neural_net.eval()