DataForWater / IWaVE

Image Wave Velocimetry Estimation
MIT License
0 stars 0 forks source link

Optimization analysis #4

Open hcwinsemius opened 8 months ago

hcwinsemius commented 8 months ago

Investigate candidate methods. Lightweight optimization methods preferred for speed.

hcwinsemius commented 6 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.

hcwinsemius commented 5 months ago

How to test??

hcwinsemius commented 4 months ago

Matlab version used so far is fmincon with interior point method. One window of 5800 frames [64, 64] took 4 seconds on a laptop.

dolcettig commented 4 months ago

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.

hcwinsemius commented 2 months ago

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

hcwinsemius commented 1 month ago

The most time consuming function in the optimization currently is taking 90-95% of the time and is dispersion.gauss_spectrum_calc