All Questions
Tagged with performance numpy
239
questions
4
votes
2
answers
108
views
Srivastava multivariate Fox H function in MATLAB
I was trying to rewrite the Python code in MATLAB.
The result is consistent.
But, the MATLAB code is so slow. Any help would be appreciated.
Ref python code link
The MATLAB code written by me is as ...
3
votes
5
answers
1k
views
How do I speed up this simulation program
This is a program to solve a differential equation numerically using Euler method. As of now, it is very slow, and I need to run 10000 Monte Carlo simulations.
The differential equation is called ...
3
votes
1
answer
157
views
Snake from the viewpoint of the snake
I wrote a little game of snake that where you can see the field in which the snake moves fixed and you can also see the "viewpoint" of the snake, which is basically calculating the positions ...
4
votes
2
answers
166
views
NumPy script to convert BGR to HSL and back
This is a NumPy script that converts BGR arrays to HSL arrays and back, without using OpenCV. Input and output values are arrays of 3 dimensions with values ranging from 0 to 1, the shape of the ...
5
votes
1
answer
82
views
Generating Abelian sandpile "zeros" in python
Here is some code that generates the zero element of an Abelian sandpile model (ASM), for any given model dimensions, and then plots the result as a colormesh. Here is a wiki page explaining the ASM. ...
0
votes
1
answer
207
views
Find the first value bigger than a threshold
This function takes two inputs: A is 2D (N,5) while B is 1D (N).
It tries to find the smallest ...
2
votes
1
answer
179
views
Is this the right implementation for Linear Programming (puLP) on python?
I have created a LP function to help maximize a set of features. My first time playing with this library and also conducting LP.
Variables:
Number of features => X
Number of Categories => Y
...
4
votes
3
answers
411
views
Pairwise Euclidean distance search algorithm
x and y are two-dimensional arrays with dimensions (AxN) and (BxN), i.e. they have the same number of columns.
I need to get a matrix of Euclidean distances between each pair of rows from x and y.
I ...
6
votes
1
answer
135
views
basic Hartee-Fock program to compute the total energies and some properties of a molecule
I am trying to write a basic Hartee-Fock program that computes the total energies and some properties of a molecule given as an input. The code uses Cython to statically compile the computationally ...
2
votes
1
answer
241
views
AI In 2048 Game, Calculations so slow
Inspired by this answer on stackoverflow for AI implementation in 2048 game.
I have been trying to make AI calculate best move by playing the game given specific times in memory preceding by one ...
6
votes
2
answers
482
views
Means square displacement (MSD)
I have written a code to calculate the MSD of some molecules. The code averages over multiple time origins (sliding time window) and over all the molecules. I have also made it do one extra thing: do ...
8
votes
2
answers
525
views
Fourier Series of a given function
This is a very simple code that expresses a function in terms of Trigonometric Fourier Series and generates a animation based on the harmonics. I would like to know some ways to improve the ...
3
votes
1
answer
161
views
Solve an option pricing PDE in Python - Part 1 [closed]
The Github repository NM-Heston solves call option prices under the Heston 2-factor model using ADI splitting schemes. I am adapting the code to price options under the 3-factor Heston-Hull-White ...
3
votes
0
answers
103
views
E-car-sharing problem with charging between the bookings
I am writing code that, at some later point, will be part of an academic multi-agent simulation of the learning process of car-sharing users and grid stability. This code deals with finding the price ...
4
votes
1
answer
134
views
Neural Network Written in Python is Extremely Slow
I coded a basic feedforward neural network with all pure python with the exception of numpy in order to better understand how neural networks work. It works, but the only problem is it is extremely ...