Even though my model and parameters seem to be correct (all previous exercises have been checked and are correct), I still have a linear decision boundary after training my neural network with four hidden units (see image).
Does anyone have any idea why it remains linear?
Since my parameters are correct, it may come from the predict function, but it was checked and I only had two lines to complete in that function, so I don’t know where I could be going wrong.
It’s strange. If you passed all the above tests in your Planar data classification with one hidden layer assignment, then your result should look like this:
Have you hard-coded anything, like n_h in your initialize_parameters? Or anything else? If not, try Kernel → Restart, then rerun all the cells and see.
Thanks for your answer.
I agree that it is strange but I don’t think I hardcoded anything (except n_h where it was requested, so not in “initialize_parameters”). I restarted and got the same results.
I don’t think I’ll investigate this any further as it doesn’t stop me from completing this project but it does confuse me to not understand.
Ok. In your nn_model, you are passing t_X and t_Y to forward_propagation, compute_cost, and backward_propagation. Why? Your nn_model don’t know what is t_X and t_Y but X and Y.
Indeed, actually, I just copied-pasted these functions from above without paying attention to them and since the tests were good, I didn’t recheck them…
Thank you very much, it’s working now.