There might be a mistake in your code

Post Reply
Posts: 6
Joined: Thu May 28, 2020 3:58 am

There might be a mistake in your code

Post by leon1209 » Sun Jun 21, 2020 1:59 am

Hi LazyProgrammer,

I was at the code implementation glove in code with Alternating Least Squares lecture (lecture 9), I think you might have a mistake in terms of updating bias term b and c. I'll use b term to illustrate my point. Since typing for equation on this one is very hard, I wrote my derivation on paper. Please have a look.

Generally speaking, I think the mistake that you might have is that you assumed there is a SUM(f(i,j)) term ahead of the "lambda*b(i)" term(i.e., the dashed box in my paper). Because if I derive the equation based on this assumption, I get what you get.

However, I don't think we should surround the "lambda*b(i)" term with SUM(f(i,j)), because we don't surround the regularization term with SUM at the very beginning of the derivation. When you did derivation including the regularization term in your video, you didn't surround the regularization term with SUM either.

Here is my derivation (upper half is my solution, lower half is yours), and I also attached a photo of your code implementation about this.

photo of your code about this part:
my derivation:

Please let me know what you think. Thank you.

Post Reply

Return to “Natural Language Processing with Deep Learning in Python”