GitHub - SciML/NeuralLinearSolve.jl: Neural Network Enhanced Linear Solvers · GitHub
Skip to content

About

Neural Network Enhanced Linear Solvers

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

31 Commits

Folders and files

Repository files navigation

NeuralLinearSolve.jl

Join the chat at https://julialang.zulipchat.com #sciml-bridged Global Docs

codecov Build Status

ColPrac: Contributor's Guide on Collaborative Practices for Community Packages SciML Code Style

NeuralLinearSolve.jl is a Julia package that uses a pretrained CNN to predict the fastest direct linear solver for a given sparse matrix.

Given a SparseMatrixCSC, the package generates a 64×64 SPY plot image and passes it through a frozen CNN to classify the matrix into one of three solver categories: UMFPACK, KLU, or Pardiso.

Installation

using Pkg
Pkg.add("NeuralLinearSolve")

Example Usage

using NeuralLinearSolve
using SparseArrays

A = sprand(1000, 1000, 0.01)

# Get the recommended solver
solver = predict_solver(A)
# e.g. :KLU

# Get the full probability distribution over solvers
probs = predict_solver_probs(A)
# e.g. Dict(:UMFPACK => 0.05, :KLU => 0.91, :Pardiso => 0.04)

The CNN was trained on timing data from the SuiteSparse Matrix Collection, comparing solve times for UMFPACK, KLU, and Pardiso across ~1000 sparse matrices. It achieved 94.2% test accuracy on held-out matrices.

Supported solvers

Symbol Solver LinearSolve.jl algorithm
:UMFPACK UMFPACK (default Julia sparse solver, via SuiteSparse) UMFPACKFactorization()
:KLU KLU (via SuiteSparse) KLUFactorization()
:Pardiso MKL Pardiso (Intel MKL) MKLPardisoFactorize()

License

MIT

About

Neural Network Enhanced Linear Solvers

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages