Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Numpy NdArray Memoization

I'm working on some fairly computational intensive calculations that deal with numpy matrices and ndarrays, and from some digging around, there are about a dozen ways not to implement memoization, generally full of collisions, and issues with ndarrays being mutable objects.

Has anyone come across a fairly general memoisation decorator that can handle numpy objects?

like image 644
Bolster Avatar asked Mar 19 '11 14:03

Bolster


2 Answers

How about this package:

http://packages.python.org/joblib/memory.html

2021 update https://joblib.readthedocs.io/en/latest/generated/joblib.Memory.html

like image 126
JoshAdel Avatar answered Nov 20 '22 15:11

JoshAdel


An alternative is my package jug:

http://packages.python.org/Jug

It is similar to joblib, but with a slightly different approach.

like image 25
luispedro Avatar answered Nov 20 '22 16:11

luispedro