LFD Book Forum  

Go Back   LFD Book Forum > Course Discussions > Online LFD course > Homework 5

Reply
 
Thread Tools Display Modes
  #11  
Old 07-30-2012, 03:24 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,478
Default Re: SGD Movie rating example

Quote:
Originally Posted by invis View Post
Is it right:
\triangledown e_{ij} = \frac{\delta e_{ij}}{\delta u_{ik}}\hat u_i + \frac{\delta e_{ij}}{\delta v_{jk}} \hat v_j
You get 2K such terms with \hat u_{i1},\hat u_{i2},\cdots,\hat u_{iK} and \hat v_{j1},\hat v_{j2},\cdots,\hat v_{jK}. The coefficients of these terms are indeed \frac{\delta e_{ij}}{\delta u_{ik}} and \frac{\delta e_{ij}}{\delta v_{jk}} (for k=1,\cdots,K). All you need is to evaluate these partial derivatives, which is straightforward.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #12  
Old 07-31-2012, 02:28 AM
invis invis is offline
Senior Member
 
Join Date: Jul 2012
Posts: 50
Question Re: SGD Movie rating example

\frac{\delta e_{ij}}{\delta u_{ik}}\hat u_i = (-2r_{ij}v_{jk} + 2u_{ik}v_{jk}^2)

\frac{\delta e_{ij}}{\delta v_{jk}} \hat v_j = (-2r_{ij}u_{ik} + 2v_{jk}u_{ik}^2)

So \triangledown e is array size of i*j*2K containing real numbers ? (I mean when I try to compute it)

And after computing \triangledown e we can update u_i such that:
new u_i = u_i + \eta \sum_{j=1}^J e_{ijk}

using here K from \frac{\delta e_{ij}}{\delta u_{ik}}\hat u_i

So it will be the sum of two 1*K dimensional vectors.

Using the same logic for v_j and repeat the loop untill error reach his global minimum.

Think that I miss something again
Reply With Quote
  #13  
Old 07-31-2012, 03:32 AM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,478
Default Re: SGD Movie rating example

Quote:
Originally Posted by invis View Post
So \triangledown e is array size of i*j*2K containing real numbers ?
When you consider one rating at a time, which you do when you use SGD, then i and j will be fixed and you have only 2K variables.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #14  
Old 08-01-2012, 02:32 AM
invis invis is offline
Senior Member
 
Join Date: Jul 2012
Posts: 50
Default Re: SGD Movie rating example

Thanks a lot, Professor !

Actually I finish this example
But I dont have a real data, so just create some by random.
My rating is array size of 20*20 integer numbers from 1 to 5, U an V is 20*4 real numbers between 0 and 1.

I know that it is impossible to learn something from random data, but thats my E_{in} for 1000 iterations and \eta = 0.07

Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:49 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.