vankesteren / ProportionalFitting.jl

Multidimensional iterative proportional fitting in Julia
https://vankesteren.github.io/ProportionalFitting.jl
MIT License
7 stars 0 forks source link

Memory efficiency #12

Open vankesteren opened 2 years ago

vankesteren commented 2 years ago

The algorithm can still be improved. Currently, for each factor update we create an array with the original size and perform the multiplications. However, we could do two alternative things:

  1. Remove inner iterations: In each iteration, create the array once, perform the full factor multiplication, then compute the margins and divide them by the appropriate factor to get the update. Would require more outer iterations but fewer multiplications in total I think
  2. Compute a smaller array for each factor where summation is then easier (not really sure how yet).
vankesteren commented 2 years ago

number 2 should be a pretty good improvement, just cyclic looping over each dimension and adjusting it not based on all other dimensions but only based on the "previous" dimension.