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

[WIP] Add support for labels when visualizing embeddings #112

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ehofesmann
Copy link
Member

@ehofesmann ehofesmann commented Oct 28, 2022

UMAP fitting supports labels for supervised dimensionality reduction allowing it to accept an (incomplete) set of labels. It allows you to guide how the dimensionality reduction is performed to structure the embedding space based on certain tagged attribute.
Example workflow:

  • Take the coco dataset

  • tag 5 images of people and 5 with no people

  • compute embeddings to generate this plot which distributed all samples along the axis of "personness"
    image

  • select samples of the tails of this distribution and tag them as "person" and "not person"

  • Recompute embeddings to get an even more structured embeddings visualization
    image

  • Iteratively add good examples of classes, recomputing the visualization each time to generate more accurate clusters

This was all done just using tags in the App:

def visualize_from_tags(dataset, embeddings):
    labels = [t[0] if t else None for t in dataset.values("tags")]
    results = fob.compute_visualization(dataset, embeddings=embeddings, labels=labels)
    plot = results.visualize(labels=(F("tags").length() > 0).if_else(F("tags")[0], "None"))
    return plot

@ehofesmann ehofesmann added the feature Work on a feature request label Oct 28, 2022
@ehofesmann ehofesmann self-assigned this Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Work on a feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant