comp-imaging / ProxImaL

A domain-specific language for image optimization.
MIT License
112 stars 29 forks source link

Cache processed right-hand side for direct least squares solver #12

Closed SteveDiamond closed 10 months ago

SteveDiamond commented 8 years ago

We should cache (K^TK)^{-1}K^Tb when repeatedly solving ||Kx - b||^2 + (\rho/2)||x-v||^2 directly.

antonysigma commented 11 months ago

Note to self: this can be done with the Halide's cache mechanism:

https://halide-lang.org/docs/class_halide_1_1_func.html#a13f23665f247f820d971a34ad18171fe

The only catch is the need of a "hash" indicating the change of buffer b contents. The hash compute overhead may be higher than that of K_T b, defeating the purpose.

SteveDiamond commented 10 months ago

Nice!