Hello I am getting an error in week 3 Assignment and in exercise 7
It says wrong value of W1
does it have something to do with copy.deepcopy for W1 and W2?
I have used correct formula for updating W1,W2,b1 and b2 but still I am getting this error
Someone please help
Here are my results from that test cell:
W1 = [[-0.00643025 0.01936718]
[-0.02410458 0.03978052]
[-0.01653973 -0.02096177]
[ 0.01046864 -0.05990141]]
b1 = [[-1.02420756e-06]
[ 1.27373948e-05]
[ 8.32996807e-07]
[-3.20136836e-06]]
W2 = [[-0.01041081 -0.04463285 0.01758031 0.04747113]]
b2 = [[0.00010457]]
All tests passed!
Notice that yours differ in most cases in the 4th or smaller decimal places. That must mean there is something different about your code. Are you sure you didn’t use a different value of \alpha (the learning rate)?
Actually, that is exactly the problem: you changed the template code. Here’s what the definition of that function is in my notebook:
# GRADED FUNCTION: update_parameters
def update_parameters(parameters, grads, learning_rate = 1.2):
So why did you change the default value of the learning rate to be 1.5, when the value they gave you was 1.2? This is a problem because the test cases actually do not pass that value, so the default is the one that is actually used in both test cases (the one you can see and the one in the file public_tests.py
).
It’s never a good idea to modify the parts of the logic outside the “YOUR CODE HERE” sections. It’s not against the rules, but you need to be sure that you know what you’re doing when you “go there”.
Thanks for the prompt reply. So I don’t know why but in my notebook the value of learning rate was already set to 1.5
It was late in night yesterday in this part of the world so i posted the question and went to sleep thinking that may be someone is gonna reply or not and with a will to sort it out myself the next day. So today early morning i googled the exact same query and found a page where learning rate was mentioned as 1.2
https://kawshikbuet17.github.io/Coursera-Deep-Learning/01-Neural-Networks-and-Deep-Learning/Codes/Week%203/Planar%20data%20classification%20with%20one%20hidden%20layer/Planar_data_classification_with_onehidden_layer_v6c.html
I changed and then it passed all the tests and have even completed the assignment
Thanks for the response and now i can be rest assured that my queries will be answered.
Cheers
Please note that if you are finding solutions on the internet, that there have been a number of versions of these various notebooks, so you can’t just assume that any one you find will work with the current state of the assignment. In particular that one with _v6c in the name is an old one. But that particular point about the default value of the learning rate does happen to be connect.
If you are actually using solutions you find on the internet, also note that is a violation of the rules here, in addition to not being reliable if the notebook you find is not current or not correct (in the case of the erroneous 1.5 value).
I Just used the learning rate value.
Nothing else.
That too because I didn’t know that my notebook was showing wrong value.
And you didn’t get your original notebook from someplace other than the course website? Because I checked and the learning rate is 1.2 in the clean notebook from the course. So if you got your notebook from the course, then you must have made that change. Maybe you don’t remember doing that, but there is no other explanation that I can think of. Notice that the formatting is different as well: no spaces around the equal sign and a space after the value. My post shows how it looks in the “clean” course notebook.