Linear algebra support
See original GitHub issueShare we support linear algebra?
Thank you for your hardworking, I’m so happy that we do not need to rember the damned “axis number” in normal situations. But sometime we should still use the functions of linear algebra like LUdepart or determinant.
Follow is the codes to explain some personal idea of new functions API.
#code
>>>Adata = np.random.randn(4,4,7)
>>>A = DataArray(Adata, dims=('x','y','z'))
>>>L, U = LUdepart(A, dims1='x', dims2='y',newdims='a')
#result
>>> L
DataArray(x:4, z:7, a: 4)
...
>>> U
DataArray(y:4, z:7, a: 4)
...
>>>L@U == A
True
I think other essential linear algebra function in numpy can be wraped by this way so that we will can use their named axis version. Do you have any suggestions? Finally, thankyou again for your work.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Support (mathematics) - Wikipedia
Support (mathematics) · 1 Formulation · 2 Closed support · 3 Compact support · 4 Essential support · 5 Generalization · 6 In...
Read more >Support of a vector - linear algebra - Math Stack Exchange
Let v be an n-dimensional sign vector, i.e., a vector in {+,−,0}n. The following is a natural partition of [n] induced by v....
Read more >What does support mean in mathematics, as in [math ... - Quora
The support is the closure of the set of points for which the function is not zero. Otherwise said, all points for which...
Read more >Linear Algebra - Khan Academy
Learn linear algebra for free—vectors, matrices, transformations, and more.
Read more >Linear algebra support modules for approximation and other ...
This paper describes a suite of modules which has been used extensively in practice for this purpose and which forms the core of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have created a library for easier linear algebra (plus others) with xarray: https://xarray-einstats.readthedocs.io/en/latest/.
It currently has:
numpy.linalg
functionsscipy.stats
distributions plus a few functionsnumba.guvectorize
-decorated version ofnumpy.histogram
for dataarraysI have mostly added wrappers for things I personally use, also trying to not overlap with xr-scipy nor xarray-extras, so it might not make much sense as a group, but the modules are completely independent between them and could be reorganized into independent packages or merged into existing ones.
Feedback very welcome!
Great, thanks for the offer 😄 I think I’ll start with a minimal repo back at ArviZ and see how much of that can be used more generally. I probably should have named the example above
arviz_dot
instead. I definitely want to be able to doarviz_dot(a, b)
and have it work automatically because in most ArviZ cases we do have all the information we need for this to be possible. We’ll therefore definitely need a higher ArviZ layer, but I think an xarray-linalg would be a great base on which to build and we can keep both in different files/modules so it can be split easily.I also commented here as I thought it was the most related issue, many of the functions I have in mind are related to linalg, but we’ll probably have some other functions too.