28 Commits

Author SHA1 Message Date
Peter Hawkins
efdcef88c7 Remove experimental warning from linalg routines.
There's no particular reason to scare people with the experimental warning any longer; we don't know of any bugs here.
2019-07-23 21:13:14 -04:00
Peter Hawkins
12e622bbc1 Implement np.linalg.inv in terms np.linalg.solve.
i.e. use an LU decomposition instead of a QR decomposition, now that an LU decomposition is available on all platforms.
2019-06-28 15:49:38 -04:00
Peter Hawkins
a396276e78 Add unit_diagonal option to lax_linalg.solve_triangular.
LAPACK and cuBLAS both support treating the diagonal of a triangular matrix as 1 and ignoring the actual matrix contents. Plumb this ability through to lax.
2019-06-25 15:27:37 -04:00
Peter Hawkins
f53ede7e5f Add batching support to numpy.linalg.solve. 2019-06-17 20:52:43 -04:00
Peter Hawkins
a96944eb53 Implement np.linalg.eig on CPU.
Fixes #639.
2019-05-13 15:59:58 -04:00
Matthew Johnson
0cf14837c9 make a lax package, revert control flow names (#607)
c.f. #597
pair=skyewm
2019-04-12 16:28:40 -07:00
Anselm Levskaya
8cd3f448d5 fix missing symmetrize_input arg 2019-02-14 00:40:42 -08:00
Anselm Levskaya
8a84ae8d2a added jvp rule for eigh, tests 2019-02-13 21:50:39 -08:00
Matthew Johnson
78fd9e1a10 debug cholesky grad, remove stale dot_general check 2019-02-13 09:18:28 -08:00
Peter Hawkins
55acfb15e6 Implement np.linalg.norm. 2019-02-07 10:51:55 -05:00
Peter Hawkins
652f0df017 Fix some TODOs in linalg: use gather instead of matmul to permute matrix rows. 2019-02-04 21:48:03 -05:00
vishwakftw
e16f31e94f Merge branch 'master' of https://github.com/google/jax into svd 2019-01-08 09:30:05 +05:30
vishwakftw
954b047bea Address review comments 2019-01-08 09:24:48 +05:30
Peter Hawkins
1c2cff15d2 Finish implementation of symmetric eigendecomposition on CPU:
* add test case.
* add double and complex64 implementations.

Also add logic to all linalg methods to both coerce arguments to arrays, and to promote to an inexact (float or complex) type if the argument is not inexact.
2019-01-07 19:20:42 -05:00
vishwakftw
484db1e15f Add SVD for float and double types 2019-01-05 11:13:08 +05:30
Peter Hawkins
06135fa6f5 Implement numpy.linalg.solve and scipy.linalg.solve.
Make Cholesky and TriangularSolve work for complex numbers on CPU. The HLO implementations are broken for complex numbers on GPU/TPU, so no tests enabled for these yet.
2018-12-21 16:29:45 -05:00
Peter Hawkins
a4386457e2 Fix test failures due to type mismatches in linear algebra tests.
Minor code cleanups.
2018-12-21 15:18:34 -05:00
Peter Hawkins
b68c93d37f Implement np.linalg.slogdet.
Change implementation of np.linalg.logdet to call np.linalg.slogdet.

Add support for complex64 LU decomposition.
2018-12-20 22:18:20 -05:00
Peter Hawkins
dfdc2e3806 Add LU decomposition implementation backed by LAPACK on the CPU platform.
Implement np.linalg.det, and scipy.linalg.{lu,lu_factor,det}.

Add missing abstractification to loop arguments.
Implement XLA abstractification rules for AbstractTuple, ConcreteArray, and ShapedArray.
2018-12-20 18:45:34 -05:00
Peter Hawkins
ab1ebc6bad Add experimental warning to numpy.linalg and scipy.linalg. 2018-12-17 17:39:46 -05:00
Peter Hawkins
13a135d424 Implement lower=False case for scipy.linalg.cholesky.
Remove np.linalg.{dot,matmul,trace}, because these aren't part of the numpy API. I had previously misinterpreted the np.linalg documentation to mean that they also existed in that module.
2018-12-15 10:22:42 -05:00
Peter Hawkins
23525bd9b5 Add scipy.linalg.inv as well. Simplify the QR call in np.linalg.inv. 2018-12-13 21:02:24 -05:00
Peter Hawkins
3aad9b68f6 Implement np.linalg.inv using a QR decomposition.
An LU decomposition would probably be preferable; we can switch the implementation when we have an LU decomposition.

Fixes #44.
2018-12-13 19:28:05 -05:00
Matthew Johnson
c5d6c9f09f Merge remote-tracking branch 'origin/master' 2018-12-13 11:56:23 -08:00
Matthew Johnson
a285017110 fix failing tests (misc small bugs) 2018-12-13 11:52:41 -08:00
Peter Hawkins
3561b432c2 Add Cholesky, QR, and Triangular solve implementations.
* Adds lax.{cholesky,triangular_solve,qr}. Adds a JVP for Cholesky.
* Adds a transpose rule for add_p, needed by the Cholesky JVP.
* Adds np.linalg.{cholesky,qr,dot,matmul,trace}.
* Adds scipy.linalg.{cholesky,qr,solve_triangular,tril,triu}.

Pair programmed with mattjj.
2018-12-13 13:03:08 -05:00
Peter Hawkins
dad72f94da Add missing license header to Python files. 2018-12-12 08:45:06 -05:00
Alex Wiltschko
0b7bed8778 Adding unimplemented functions to numpy.random, numpy.fft and numpy.linalg 2018-12-11 12:44:02 -05:00