Skip to content
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

Catch Exception in BLR #72

Open
cortner opened this issue Sep 26, 2023 · 2 comments
Open

Catch Exception in BLR #72

cortner opened this issue Sep 26, 2023 · 2 comments

Comments

@cortner
Copy link
Member

cortner commented Sep 26, 2023

The following error seems to occur quite frequently:

ERROR: LoadError: PosDefException: matrix is not positive definite; Cholesky factorization failed.
Stacktrace:
  [1] checkpositivedefinite
    @ ~/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/factorization.jl:18 [inlined]
  [2] #cholesky!#152
    @ ~/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/cholesky.jl:268 [inlined]
  [3] cholesky! (repeats 2 times)
    @ ~/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/cholesky.jl:266 [inlined]
  [4] log_marginal_likelihood_overdetermined!(lml::Float64, grad::Vector{Float64}, X::Matrix{Float64}, y::Vector{Float64}, var_c::Vector{Float64}, var_e::Float64, XTX::Matrix{Float64})
    @ ACEfit.BayesianLinear ~/miniconda3/envs/ase_env/share/julia/packages/ACEfit/eR8hX/src/bayesianlinear.jl:285
.... 

and it keeps going for a while. Maybe this could be caught with a nicer error message explaining what might have gone wrong and what to try next, e.g. adding better data or trying a different solver.

If the solver can be fixed to actually handle this case, even better.

@YuanbinLiu
Copy link

I also encountered this issue recently. Has it been resolved? Could it be a solution to change BLR to LSQR?

@wcwitt
Copy link
Collaborator

wcwitt commented May 6, 2024

This definitely does need better error handling and a more helpful message. I can't do it today but will push something later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants