Closed din14970 closed 1 year ago
Your linear system is extremely ill-conditioned:
>>> np.linalg.cond(A.T @ A)
4.786320491726312e+17
In other words, this is not a reasonable input for Cholespy (in particular, the single precision variant). You can read more on conditioning of linear systems here: https://en.wikipedia.org/wiki/Condition_number#Matrices
Thanks for publishing this project! I want to see if I can use it for solving least squares problems directly with
A.T.dot(A.dot(x)) = A.T.dot(b)
. To see if this works I played around with some simple test with some made up valuesI then pass the details from a sparse COO representation of
A.T.dot(A)
to instantiate theCholeskySolverF
:When I use numpy for this entire procedure it seems to work fine and the test passes. The answer I get is
[-0.29087737, 0.11811837, 0.11518325]
. For cupy I get a clearly incorrect answer which looks a lot like some overflow issue is going on:[ 65558.29 , -131117.05 , 65558.695]
. By usingCholeskySolverD
both numpy and cupy give me a reasonable answer.I thought I would report this here. Perhaps if there runaway numerical errors occurring the code could give a warning/error?