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

Add improved version of Hungarian algorithm. #1140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

carlosgmartin
Copy link
Contributor

Follow-up to #1083 (comment).

Copy link
Collaborator

@vroulet vroulet left a comment

Choose a reason for hiding this comment

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

Thanks again @carlosgmartin!
Some suggestions:

  • keep a single file, and name the first algorithm you did as "base_hungarian_algorithm"
  • add in e.g. the new algorithm's docstring a sentence that differentiates the two implementations.
  • Add a test that compares the results between the two implementations maybe

Otherwise it's great

@carlosgmartin
Copy link
Contributor Author

carlosgmartin commented Nov 21, 2024

@vroulet Seems to me it’s cleaner to keep each implementation in a separate file, since

  1. It keeps the implementations less entangled and keeps their respective helper functions separate, avoiding potential confusion.
  2. It keeps the modules shorter/less crowded, especially if more implementations are added in the future.

WDYT?

@vroulet
Copy link
Collaborator

vroulet commented Nov 22, 2024

It keeps the implementations less entangled and keeps their respective helper functions separate, avoiding potential confusion.

In any case we should add in the docstring why they differ.

It keeps the modules shorter/less crowded, especially if more implementations are added in the future.

I would actually agree with you, but typically the alias file in optax has an ever increasing list of optimizers. So let's keep the same logic here. (That would actually be my main argument in favor of keeping them in a single file: it may be better for the package to follow a similar philosophy across folders/files).

@carlosgmartin carlosgmartin force-pushed the improved_hungarian_algorithm branch from 64cdc1d to f134068 Compare November 23, 2024 20:21
@carlosgmartin
Copy link
Contributor Author

@vroulet Done.

Copy link
Collaborator

@vroulet vroulet left a comment

Choose a reason for hiding this comment

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

Thanks again @carlosgmartin !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants