Collaborative Filtering Gradient
This commit is contained in:
		
							parent
							
								
									fc28204594
								
							
						
					
					
						commit
						e1e66778f8
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -42,6 +42,8 @@ Theta_grad = zeros(size(Theta));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
J = 0.5 * sum(sum(R.*(X*Theta'-Y).^2));
 | 
					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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
% =============================================================
 | 
					% =============================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue