[Numpy-discussion] Re: Feature proposal: weighted gram matrix / sandwich product

2025-09-04 Thread Christian Lorentzen via NumPy-Discussion
Hi Kevin As I wrote in my original mail, BLAS has no routine for this operation, you need at least 2 BLAS (or numpy) operatios and I'd like to avoid the drawback of those solutions because this is a very performance critical and memory bound operation (X can be very large). The undertaking o

[Numpy-discussion] Re: Feature proposal: weighted gram matrix / sandwich product

2025-09-02 Thread Christian Lorentzen via NumPy-Discussion
As nice as numba is, it’s a very heavy dependency that many high profile libraries want to avoid.BestChristian Am 18.08.2025 um 14:25 schrieb Kevin Sheppard :This is a good place for numba if performance and memory use are a concern.Good NumPy125 ms ± 2.42 ms per loop (mean ± std. dev. of 7 runs,

[Numpy-discussion] Re: Feature proposal: weighted gram matrix / sandwich product

2025-08-18 Thread Kevin Sheppard via NumPy-Discussion
This is a good place for numba if performance and memory use are a concern. Good NumPy 125 ms ± 2.42 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) Naive numba (memory efficient) 386 ms ± 1.83 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) Parallel numba (memory efficient, cpu bo

[Numpy-discussion] Re: Feature proposal: weighted gram matrix / sandwich product

2025-08-18 Thread Christian Lorentzen via NumPy-Discussion
If W is just a vector, i.e. my main use case, than what you write is what I wanted to imply and actually how I implemented it in several cases. The point is that X.T * weights[None, :] still doubles memory (same size as X) and this solution doesn't exploit the symmetry. Best Christian On 17.08

[Numpy-discussion] Re: Feature proposal: weighted gram matrix / sandwich product

2025-08-17 Thread Kevin Jacobs
Why not: XTWX = (X.T * weights[None, :]) @ X if `weights` is a vector? Allocating `diag(weights)` is the big memory and CPU hog at least for my generally long and skinny X matrices. -Kevin On Fri, Aug 15, 2025 at 10:08 AM Christian Lorentzen via NumPy-Discussion < numpy-discussion@python.org>

[Numpy-discussion] Re: Feature proposal

2025-08-08 Thread rybakov.ad--- via NumPy-Discussion
Well, what I ment to say was "Perhaps just the treatment of complex numbers is not available". Best, Andrey ___ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.p

[Numpy-discussion] Re: Feature proposal

2025-08-07 Thread Marten van Kerkwijk
Hi Andrey, I don't think this kind of formatting belongs in numpy: there is no obvious correct way to display numbers in tabular form, and this just invites a hard-to-maintain jungle of keyword arguments. For instance, I find lines in tables generally unnecessary, so they need to be optional. But

[Numpy-discussion] Re: Feature proposal

2025-08-07 Thread rybakov.ad--- via NumPy-Discussion
Perhaps just the treatment of complex numbers. Best, Andrey ___ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3//lists/numpy-discussion.python

[Numpy-discussion] Re: Feature proposal

2025-08-07 Thread Андрей Рыбаков via NumPy-Discussion
I see that the examples were misformatted, here how they were intended to look like. Best, Andrey ___ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.

[Numpy-discussion] Re: Feature proposal

2025-08-05 Thread John Mark Agosta via NumPy-Discussion
How much of this functionality is available in the tabulate package? _JM __ John Mark Agosta LinkedIn: https://www.linkedin.com/in/john-mark-agosta/ johnmark.ago...@gmail.comFind me at https://medium.com/@johnmark54 On Tue, Aug 5, 2025 at 6:55 AM Андрей Рыба