New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-14509 option to dump matrix and gradient to file #87
Conversation
2a42b88
to
9ed6ca7
Compare
Add config for outputting hessian/gradient and test.
Log the total number of model parameters on model construction, to help with debugging. Cleanup the parameter calculation in tests and add tests for the above method.
9ed6ca7
to
1fb0cb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall things look good, although I question the placement of the code to dump the matrix to a file. While it involves calculating the Hessian an extra time outside of the loop, presumably writing the matrices is only done during debugging so the slightly longer runtime shouldn't be noticeable compared to the time it takes to write out the matrices.
self.config.outlierRejectSigma, | ||
doRankUpdate=doRankUpdate, | ||
dumpMatrixFile=dumpMatrixFile) | ||
dumpMatrixFile = "" # clear it so we don't write the matrix again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do this a few times. Couldn't this be avoided if createHessian
took a dumpMatrixFile
parameter instead, and you call createHessian
before this loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createHessian
is in an anonymous namespace, and it requires building the triplet list by computing the derivatives first, so there's a fair bit of code that would have to be lifted into python first, which would make the public API more complicated than it needs to be.
Also, the Hessian is re-computed after every outer loop call to minimize
(after some amount of outlier rejection).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I still think that this implementation is less than ideal, but it probably isn't worth complicating the API over.
No description provided.