Skip to main content
1 vote
0 answers
48 views

I was writing code for the simulation of the fluid dynamics of a layer of water. It has a function of solid_liquid_layer_angular_velocity_change: def solid_liquid_layer_angular_velocity_change( ...
YingKai Niu's user avatar
3 votes
1 answer
138 views

I'm writing some Hamiltonian evolution code that relies heavily on matrix multiplication, so I've been trying to learn about developing for a GPU using python. However, when I run these lines of code ...
user2506833's user avatar
5 votes
2 answers
270 views

I'm using Python 3.12.11 with Numba 0.61.2 on Ubuntu 22.04.5 and AMD Ryzen 7 3800X CPU. This benchmark: import numpy as np, timeit as ti, numba as nb @nb.njit(fastmath=True) def f1d(img, w): fl = ...
Paul Jurczak's user avatar
  • 8,630
0 votes
1 answer
146 views

I want to have a factory method that calls a cfunc using numpy arrays. I am trying to pass the numpy arrays by using a ctype pointer. Since my original code is rather complicated I have made a simple ...
Miguel Madeira's user avatar
1 vote
1 answer
172 views

I'm trying to wrap some GSL (GNU Scientific Library) functions using Numba. I'd like to avoid C glue code wrappers and to be able to cache and extend the wrapped functions. Here’s a simplified ...
Olibarer's user avatar
  • 423
1 vote
1 answer
131 views

This Python 3.13.5 script with numpy 2.2.6 and numba 0.61.2: import numpy as np, numba as nb @nb.njit(fastmath=True) def f(a, b): return np.histogram(a, 10, weights=b) a = np.random.randint(0, 256,...
Paul Jurczak's user avatar
  • 8,630
2 votes
0 answers
104 views

The problem is illustrated by the following script, which works correctly if MKL is used for linear algebra operations: from numba import njit, prange from numpy import random, dot, empty from ...
Konstantin Karandashev's user avatar
2 votes
1 answer
195 views

This Python 3.12.7 script with NumPy 2.2.4 and Numba 0.61.2: import numpy as np, timeit as ti, numba as nb def f0(a): p0 = a[:-2] p1 = a[1:-1] p2 = a[2:] return (p0 < p1) & (p1 > p2) ...
Paul Jurczak's user avatar
  • 8,630
0 votes
0 answers
90 views

I have a ML problem where I want to leverage the power of Support Vector Classifiers (SVC) or any other 2-class classifier and compare them to my NN models. The probelm is, that binary classifiers are ...
user30013477's user avatar
4 votes
0 answers
238 views

Aim: I want to finetune parakeet v2 model to a different dataset. I picked LJ dataset just to make myself familiar with the finetuning process. For doing this I ran the following notebook This works ...
Deepanshu Yadav's user avatar
1 vote
1 answer
76 views

I am trying to pass a list of jitclass objects to a jitted function, but I've been unable to find a suitable type signature for njit. I don't understand well how Numba thinks, so I would really ...
Squishium's user avatar
0 votes
0 answers
118 views

I'm trying to use the %%scalene cell magic in a Jupyter Notebook running on GitHub Codespaces to profile a Numba-accelerated implementation of the Mandelbrot set. However, when I run the following ...
Ahmed Hossam's user avatar
2 votes
2 answers
102 views

I am attempting to write a fast numba guvectorized function to use with in Polars (see here). I've simplified things down to examples below. Immediately below is an example that works fine: import ...
Stephen's user avatar
  • 276
3 votes
2 answers
166 views

I find this behavior quite counter-intuitive although I suppose there is a reason for it - numba automatically converts my numpy integer types directly into a python int: import numba as nb import ...
Raven's user avatar
  • 831
2 votes
1 answer
118 views

I have written four functions that modify a square 2D array in place, it reflects half of the square array delimited by two sides that meet and the corresponding 45 degree diagonal, to the other half ...
Ξένη Γήινος's user avatar

15 30 50 per page
1
2 3 4 5
163