It seems there is an error (or rather a sequence of errors) in the programming assignment of week two. I could easily pass the assignment by stupidly following the instructions, but it seem to be wrong nevertheless:
Formula (3) in exercise 4 says:
π£ππ[π]=π½π£ππ[π]+(1βπ½)ππ[π]
If I interpret this as a mthematical equation, it would mean
(1βπ½)π£ππ[π]=(1βπ½)ππ[π] , i.e. π£ππ[π]=ππ[π]
or if I iterpret it as a program assignment, then since ππ[π] is initialised as zero:
π£ππ[π]=(1βπ½)ππ[π]
The latter is what Iβve implemented and which passes the chcks, however the correct formula should read from the lecture:
π£ππ[π]=π½π£ππ[π-1]+(1βπ½)ππ[π]
(L replaced by l-1 on the rhs).
This error seems to be essentially in all subsequent exercises.
I also faced the same problem and have the same question!!
I checked Andrewβs lecture and I found that the formula given is in accordance with the βcorrectβ answer in assignment.
I thought vdW2 should be somehow linked in vdW1 rather than itself, as what you thought.
I hope someone can answer this for me and I will check the previous questions people post and see if there is an answer
Sorry if I generated confusion, there is no error. The average must be taken over βtimeβ/steps, not over different layers, I got the indices mixed up. In zhe code, the update is performed only once, hence no real average is seen, but if several steps are performed one gets an average. relating different layers makes no sense, even the shapes will not match