OMG, I actually did work.
Jul. 14th, 2005 09:47 amAs some of you know, I have been totally stuck with no idea what to do all week, and so I've accomplished nothing but buying plane tickets to Shanghai.
Well, today, my original plan was to screw around until 10, then go to Kinko's to FedEx my visa stuff, and stop by Urban Outfitters which had a 50% off sale going on (they open at 10, that's why I was going to wait). However, I was up early and already read LJ and all my other usual websites, so I had nothing to do. I figured, okay, I'll test my code to see if this one little thing is correct, having finally thought of a way to test it. Well, during the course of this, I realized two things: (1) the minimization function, since it is minimizing instead of maximizing, is negating my gradients, which are not supposed to be negated. Solved by putting in three negative signs. (2) The minimization function is taking only the second returned value of the function as the gradient, instead of the second, third, and fourth, so it was taking the gradient wrt one parameter and applying it to all three parameters. Oops. Fixed by changing [L dg dI ds] to [L grad] and grad = [dg dI ds].
I still don't think it works, but I can't believe I managed to miss that stuff before. I guess taking a week and a half off from working on this code really helped.
Well, today, my original plan was to screw around until 10, then go to Kinko's to FedEx my visa stuff, and stop by Urban Outfitters which had a 50% off sale going on (they open at 10, that's why I was going to wait). However, I was up early and already read LJ and all my other usual websites, so I had nothing to do. I figured, okay, I'll test my code to see if this one little thing is correct, having finally thought of a way to test it. Well, during the course of this, I realized two things: (1) the minimization function, since it is minimizing instead of maximizing, is negating my gradients, which are not supposed to be negated. Solved by putting in three negative signs. (2) The minimization function is taking only the second returned value of the function as the gradient, instead of the second, third, and fourth, so it was taking the gradient wrt one parameter and applying it to all three parameters. Oops. Fixed by changing [L dg dI ds] to [L grad] and grad = [dg dI ds].
I still don't think it works, but I can't believe I managed to miss that stuff before. I guess taking a week and a half off from working on this code really helped.