LFD Book Forum  

Go Back   LFD Book Forum > Course Discussions > Online LFD course > The Final

Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2013, 04:01 AM
skwong skwong is offline
Member
 
Join Date: Apr 2013
Location: Hong Kong
Posts: 13
Default Failed to find the bias term for Q14

For Q15, I coded to find the K centers for the RBF. Then use pseudo-inverse to find the w_k. Then have difficulty to find the b. I think it should be calculated by picking any point, and substitute into the formula for x and y:

y - \sum_{k=1}^{K}w_k exp(-\gamma \|x - \mu_{k}\|^2)

But, when I try it for all 100 points, all calculated b are different. Am I mis-understand something ? Or simply my program bug ? I read through all posts in the forum but cannot figure out any hints.

Further, from "on the right track" post, I used the 4 points sample to test my code, I can find those centres and clusters and phi, but cannot match the weights.

Without proper b, I cannot carry on the simulation for the remaining quiz.
Reply With Quote
  #2  
Old 06-10-2013, 04:15 AM
bargava bargava is offline
Junior Member
 
Join Date: Apr 2013
Posts: 8
Default Re: Failed to find the bias term for Q15

b should be found along with the other weight vectors - using pseudo inverse.

This will be similar to how we did in linear regression. Add a column in the phi matrix with all 1's - and if you solve for w, you will get b.
Reply With Quote
  #3  
Old 06-10-2013, 06:08 AM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Failed to find the bias term for Q15

Quote:
Originally Posted by skwong View Post
For Q15, I coded to find the K centers for the RBF. Then use pseudo-inverse to find the w_k. Then have difficulty to find the b. I think it should be calculated by picking any point, and substitute into the formula for x and y:

y - \sum_{k=1}^{K}w_k exp(-\gamma \|x - \mu_{k}\|^2)

But, when I try it for all 100 points, all calculated b are different. Am I mis-understand something ? Or simply my program bug ? I read through all posts in the forum but cannot figure out any hints.
bargava is correct. This was discussed in a post that is buried in another thread:

http://book.caltech.edu/bookforum/sh...40&postcount=7
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #4  
Old 06-11-2013, 08:03 PM
skwong skwong is offline
Member
 
Join Date: Apr 2013
Location: Hong Kong
Posts: 13
Default Re: Failed to find the bias term for Q15

Thank you very much bargava and professor. Now I understand what is going on. Many thanks !
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 03:02 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, 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.