Wednesday, November 20, 2013

Wednesday: Tuning

I know the minimizer in the code is broken.  It's not terrible, but it can sometimes spend forever coming up with a not terribly good solution.  Since I know the starting point isn't bad for most parameters, I've not been that concerned with fixing it.

Until today.

I'm not convinced this was a mistake, but it's probably opening up a lot of hassle.  I'm now positive that there's a calculation error somewhere, which totally sucks.

Wait...[10 minutes pass].  Fuck.  Duh.

(A^T A + lambda DIAG(A^T A)) L = A^T B

I'm an idiot.  If you replace DIAG(A^T A) with the identity matrix, you don't get a gradient descent solution, so of course there's a calculation error.  You damp the stupid thing a bunch, then say, "but don't you dare fucking move."  Obviously it's not going to move in that case.

Fuck.  Ok, so that's done, and seems to work far better.  I'll need to do more testing, and I need to remove a lot of the debugging code, but I think this new solver is probably the way to go.  Now the next thing on the list is to make the models more "object oriented," since that will make adding new ones much easier.

Oh yeah, and the "everyone wants to use this on horribly reduced data, so make the program omniscient to understand what results they actually want."  Maybe I should make this as passive aggressive as possible, with just a little note in the log file:

Beep boop! I see you've run with this command line:
[USER INPUT COMMAND LINE]
However, your data doesn't really match this, so you probably didn't read the manual.  I suggest using:
[A FAR BETTER COMMAND LINE]



No comments:

Post a Comment