|
From: juenglin <jue...@cs...> - 2012-12-13 02:27:58
|
<sent off too early> You could try to force earlier restarts per the restart_fac parameter. There is a tiny bit of explanation on the parameters in the file cg_user.h. On Wed, 12 Dec 2012 18:23:45 -0800, juenglin wrote: > It sounds like you already figured out how to get some debug > information out (set PrintLevel in the cg parameters). > > You could try restarting > > > On Thu, 13 Dec 2012 00:25:32 +0000, Michael Maul wrote: >> I am having problems getting cg-descent to converge. I am re >> implementing code done in octave which converges with fminuc. >> >> Iv read through the CG-Descent users guide but am unsure where to >> start tuning. During some testing it cg-descent makes very very >> small increases of theta at each call of the gradient function. >> >> Ive tried altering the initial thetas to various values but it >> doesnt >> help. Is there perhaps a setting in cg-params that might help? >> >> Below is my cost and gradient functions if that helps shed any light >> on my problem: >> >> (defun sigmoid (theta) >> (/ 1 (+ 1 (exp (- theta)))) >> ) >> >> (defun cost (X y theta) >> (let* ((m (idx-shape X 0)) >> (h (sigmoid (* X theta))) >> (j (* (/ 1 m) (- (- (mat-.* (mat-transpose (log h)) y)) >> (mat-.* (mat-transpose (log (- 1 h))) >> (- 1 y)))))) >> (j 0 0) >> ) >> ) >> >> (defun gradient (X y theta) >> (let* ((m (idx-shape X 0)) >> (h (sigmoid (* X theta)))) >> ($*0 (* (/ 1 m) (mat-.* (mat-transpose (- h y)) X)) 0)) >> ) >> >> (cg-descent theta (lambda (t) (cost X y t)) >> (lambda (gx t) (array-copy (gradient X y t) gx)) 1e-6) > > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add > services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > Lush-users mailing list > Lus...@li... > https://lists.sourceforge.net/lists/listinfo/lush-users |