Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better tracking of n_iters #436

Closed
wants to merge 3 commits into from
Closed

Better tracking of n_iters #436

wants to merge 3 commits into from

Conversation

michalk8
Copy link
Collaborator

closes #434

@michalk8 michalk8 added the enhancement New feature or request label Sep 12, 2023
@michalk8 michalk8 self-assigned this Sep 12, 2023
Copy link
Contributor

@marcocuturi marcocuturi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -329,6 +330,7 @@ class SinkhornOutput(NamedTuple):
threshold: Optional[jnp.ndarray] = None
converged: Optional[bool] = None
inner_iterations: Optional[int] = None
n_iters: int = -1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am wondering if we need to keep inner_iterations now (it was added to compute the right number of iterations), WDYT? I think it might make sense to keep it nonetheless (e.g. when looking at errors), maybe this was your conclusion too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be safely removed, was not being used anywhere and I don't think it helps when looking at the errors. Same goes for threshold, would also remove.
Will try in the upcoming weeks to unify the output interface for our problems.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or was/is there a reason why threshold was put there before? Maybe because of traceability?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The threshold is there to settle converged in the case where min_iterations==max_iterations. It was added specifically for that case.

For inner_iterations, i think we should have the user in mind. If the user saves a SinkhornOutput as a checkpoint, it's impossible to reconstruct the "true" number of iterations that were needed to reach a certain error level, nor the threshold that conditioned stopping (apart maybe now by looking at last error not marked as -1, and then divide now n_iters by that number, but that does sound very clean)

@michalk8 michalk8 closed this Sep 12, 2023
@michalk8 michalk8 deleted the feature/better-n-iters branch September 19, 2023 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improving n_iters for linear/quadratic OT problems
2 participants