10

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?

Bolster
  • 7,460
  • 13
  • 61
  • 96

2 Answers2

9

How about this package:

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

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

keepAlive
  • 6,369
  • 5
  • 24
  • 39
JoshAdel
  • 66,734
  • 27
  • 141
  • 140
  • 11
    Could you elaborate a bit instead of just posting a link? http://meta.stackexchange.com/a/8259/130885 – endolith May 08 '13 at 16:34
1

An alternative is my package jug:

http://packages.python.org/Jug

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

luispedro
  • 6,934
  • 4
  • 35
  • 45