DVector.ipf#

DVector.ipf(targets, tol=1e-05, max_iters=100, zone_trans_cache=None)[source]#

Implement iterative proportional fitting for DVectors.

See: https://en.wikipedia.org/wiki/Iterative_proportional_fitting

Parameters:
  • targets (list[IpfTarget]) – A list of targets to try and match. Due to the nature of the process, the final target in this list will be matched most closely to. This doesn’t matter much when a good convergence is achieved, but can have a large impact when not.

  • tol (float = 1e-5) – The RMSE between self and targets the process will attempt to reach before stopping. Can also stop if consecutive iterations score the same.

  • max_iters (int = 100) – The max number of iterations which can run before the process will stop.

  • zone_trans_cache (Path | None = None) – The cache to look for translations in

Return type:

DVector matched to targets, rmse achieved.