Closed JBGreisman closed 2 years ago
As per the comment in #31, this PR seems better suited for the rs-booster
project because this is an application that uses rs
, rather than a new core feature of the library. I am closing this PR here, and will add this via a PR in rs-booster
.
This PR is still in progress, but I wanted to upload my initial classes to support this. The problem is broken down into two cases:
These classes use the sum of the squared phase residual between two sets of phases as a loss function to minimize, which has been pretty effective in my hands.
The
NonPolarTranslator
does a brute-force search of the 64 possible cases to evaluate the optimal translation vector. ThePolarTranslator
does a global optimization to determine the optimal translation vector. This is a bit non-trivial -- its a bumpy loss landscape -- but I've found the scipy dual_annealing optimizer to work very well. Another trick has been to start at low-resolution and gradually increase to full resolution. After discussion with @kmdalton, we can also use a FFT-based method to come up with a sensible initial value for optimization.My todo items: