Open hcwinsemius opened 8 months ago
Perhaps start looking for suitable optimization methods that would work for the amount of parameters we wish to optimize. Differential evolution is available but also requires a lot of runs.
How to test??
Matlab version used so far is fmincon with interior point method. One window of 5800 frames [64, 64] took 4 seconds on a laptop.
Update: I ran the test again and the actual time is approximately 1 second per 64x64 window with 5800 frames. This includes the time to calculate the spectrum.
It is typically necessary to test multiple random initialisation of the algorithm to ensure robust results. The Matlab version runs 5 initialisations per window by default, giving around 5 seconds per window.
An example optimization with scipy.optimize.differential_evolution
is given in the pyorc
code.
See (direct link to file and line number):
https://github.com/localdevices/pyorc/blob/main/pyorc/cv.py#L574
The most time consuming function in the optimization currently is taking 90-95% of the time and is dispersion.gauss_spectrum_calc
Investigate candidate methods. Lightweight optimization methods preferred for speed.