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

Suppport realtime inference for matcher #2613

Merged
merged 10 commits into from
Jan 3, 2023

Conversation

zhiqiangdon
Copy link
Contributor

Issue #, if available:

Description of changes:

  1. Add predict(), realtime_predict(), and process_batch() util functions to support both predictor and matcher.
  2. Remove _predict(), _realtime_predict(), and _process_batch from predictor.py.
  3. Add realtime inference unit tests for matcher.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link

Job PR-2613-f7516c6 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-2613/f7516c6/index.html

Copy link
Collaborator

@sxjscience sxjscience left a comment

Choose a reason for hiding this comment

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

LGTM

prob = F.softmax(logits.float(), dim=1)[:, 1]
else:
cosine_similarity = F.cosine_similarity(embeddings1, embeddings2)
prob = 0.5 * (cosine_similarity + 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to convert similarity into probability in this way? I guess users care more about the real matching similarity in most cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function is to compute the probability, normalized to range (0, 1), which is required in computing some validation metrics, e.g., roc_auc. To compute the cosine similarity, users can call another util function compute_semantic_similarity.

Copy link
Contributor

@bryanyzhu bryanyzhu left a comment

Choose a reason for hiding this comment

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

LGTM

@sxjscience sxjscience merged commit b808d09 into autogluon:master Jan 3, 2023
@zhiqiangdon zhiqiangdon deleted the mm-refactor branch January 5, 2023 06:13
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.

None yet

4 participants