From e1e66778f8ed729f68f1a0f5a671da97dfff5f27 Mon Sep 17 00:00:00 2001 From: neingeist Date: Thu, 27 Nov 2014 23:43:53 +0100 Subject: [PATCH] Collaborative Filtering Gradient --- ex8/cofiCostFunc.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ex8/cofiCostFunc.m b/ex8/cofiCostFunc.m index 37f4bfd..02d14a6 100644 --- a/ex8/cofiCostFunc.m +++ b/ex8/cofiCostFunc.m @@ -42,6 +42,8 @@ Theta_grad = zeros(size(Theta)); J = 0.5 * sum(sum(R.*(X*Theta'-Y).^2)); +X_grad = (R.*(X*Theta'-Y))*Theta; % mov X user * uxer X feat = mov X feat +Theta_grad = (R.*(X*Theta'-Y))'*X; % user X mov * mov X feat = user X feat % =============================================================