Computational-Psychiatry / 3DI

5 stars 2 forks source link

Slight inconsitencies in estimated parameters #6

Closed sariyanidi closed 10 months ago

sariyanidi commented 10 months ago

When re-running 3DI with the same exact configuration, there seems to be some slight inconsistency in the output. Practically this should not affect results, because the differences are very small, but --still-- this is a reason of concern. This seems to be an issue only in the multi-frame version of 3DI -- single-frame seems to be consistent.

sariyanidi commented 10 months ago

After detailed investigation, it looks like this may not necessarily be a bug. Inconsistencies disappear when we comment out the line with update_diagonal_of_hessian_wbounds<<<... in derivative_computer.cu. This means that, the inconsistencies may be caused by the Hessian. In particular, I suspect that the Hessian gets too large values, and therefore the matrix is not very well conditioned, which may lead to unpredictable behavior when we solve a linear system with this Hessian.

May be worth to turn the Hessian (JTJ) to double instead of float earlier in the process. (Currently, we turn it into double just before the matrix is passed into the solver).