Skip to content

implement argument to allow "some" difference between axes totals in ipfp #1004

Open
@gdementen

Description

@gdementen

Some users are complaining the following test in ipfp is too strict and annoying:

if str(axis_total) != str(axis0_total):
    raise ValueError(f"target sum along {axis} (axis {a.axes.index(axis)}) is different than target sum along "
                     f"{axes[0]} (axis {a.axes.index(axes[0])}): {axis_total} vs {axis0_total}")

The problem is that removing this test or allowing some threshold would make the total value alternate between each axis total during each iteration, systematically ending with the last axis sum, making it harder and possibly impossible to reach threshold.

In any case, it should be an immediate error if abs(axis_total - axis0_total) >= the_global_convergence_threshold, because that would make the algorithm always end at maxiter with a "bad" (unconverged) result.

One option would be to distribute the error (axis_total - axis0_total) on all labels of that axis. That should be an option though.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions