0 Vote C3W1_Assignment model loss=nan

All the code seems correct, I even tried different lr and momentum , but still the same

You got a nan loss when you run the jupyter notebook or when you submit to the grader?

Hello Youssef,

If your model training is causing loss=Nan, that would indicate that your model parameters requires adjustment to prevent causing the loss function to go to NaN.

There are various reason why you encounter NaN while training your model like

if your learning rate is too high, will cause the model parameters to become unstable. Try adjusting the learning rate and momentum accordingly and train again your model, to get the desired output.