LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   Homework 6 (http://book.caltech.edu/bookforum/forumdisplay.php?f=135)
-   -   Question on regularization for logistic regression (http://book.caltech.edu/bookforum/showthread.php?t=3996)

 melipone 02-15-2013 09:59 AM

Question on regularization for logistic regression

We have done regularization for linear regression. How do we get the gradients with regularization for logistic regression?

 yaser 02-15-2013 10:43 AM

Re: Question on regularization for logistic regression

Quote:
 Originally Posted by melipone (Post 9397) We have done regularization for linear regression. How do we get the gradients with regularization for logistic regression?
For linear regression, both the unregularized and the (weight decay) regularized cases had closed-form solutions. For logistic regression, both are handled using an iterative method like gradient descent. You write down the error measure and add the regularization term, then carry out gradient descent (with respect to ) on this augmented error. The gradient will be the sum of the gradients of the original error term given in the lecture and the weight-decay term which is quadratic in (hence its gradient will be linear in ).

 melipone 02-16-2013 01:00 PM

Re: Question on regularization for logistic regression

Thanks. Okay, so if I take the derivative of for the regularization, I just add to the gradient in the update of each weight in stochastic gradient descent. Is that correct?

I was also looking into L1 and L2 regularization. That would be L2 regularization above. My understanding is that L1 regulation would just add a penalty term to the gradient regardless of the weight itself. Is my understanding correct?

TIA

 yaser 02-16-2013 10:49 PM

Re: Question on regularization for logistic regression

Quote:
 Originally Posted by melipone (Post 9411) Thanks. Okay, so if I take the derivative of for the regularization, I just add to the gradient in the update of each weight in stochastic gradient descent. Is that correct? I was also looking into L1 and L2 regularization. That would be L2 regularization above. My understanding is that L1 regulation would just add a penalty term to the gradient regardless of the weight itself. Is my understanding correct? TIA
Indeed, you add the linear term to get the new gradient. L2 and L1 define the regularization term based on squared value and absolute value, respectively. What is added to the gradient is the derivative of that.

 All times are GMT -7. The time now is 11:45 AM.