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 UMAP to embedding projector #1901

Merged
merged 5 commits into from
Mar 26, 2019
Merged

Conversation

cannoneyed
Copy link
Contributor

@cannoneyed cannoneyed commented Feb 26, 2019

  • Motivation for features / changes

Uniform Manifold Approximation and Projection (UMAP) is a dimension reduction technique that can be used for visualisation similarly to t-SNE. I've ported the python implementation to JavaScript to add an additional projection method to the embedding projector.

  • Technical description of changes

The UMAP projection technique pretty much follows the approach for the tSNE projection. The UMAP code is grouped in its own directory for ease of maintenance. There are two things to note about this current implementation of UMAP in the embedding projector:

  1. UMAP's SGD optimization doesn't really animate as nicely as t-SNE. I've addresses this by choosing not to animate the steps and just track progress through a dialog.
  2. I'm currently reusing the GPU computed k-nearest neighbors - there didn't seem to be too big of a difference between using the UMAP CPU knn approach vs the existing GPU approach in the projector. To note, the GPU knn approach uses cosine distance, while the rest of UMAP's implementation uses euclidean distance. Again, the subjective results seem fine with this choice.
  • Screenshots of UI changes

image

  • Detailed steps to verify changes work correctly (as executed by you)

  • Alternate designs / implementations considered

@wchargin
Copy link
Contributor

Hi @cannoneyed! Thanks for the PR. We’ll likely be interested in
integrating this functionality after the TF Dev Summit next week, for
which we’re currently busy preparing.

@cannoneyed
Copy link
Contributor Author

cannoneyed commented Feb 26, 2019

Hey @wchargin! Sounds great, I figured I'd get everything in-place then we can move forward once you're through tf-dev.

@cannoneyed cannoneyed force-pushed the umap-npm branch 3 times, most recently from e269d96 to 6a4af2d Compare February 26, 2019 22:30
@wchargin wchargin self-requested a review March 8, 2019 23:44
Copy link
Contributor

@wchargin wchargin left a comment

Choose a reason for hiding this comment

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

Partial review—will have to check in again later.

@cannoneyed
Copy link
Contributor Author

OK, I've implemented the requested changes and refactored the projectUmap method to make that control flow a bit more clear. Thanks for working through this so thoroughly!

@cannoneyed
Copy link
Contributor Author

Thanks for getting around to this, and hopefully we can push through the finish line soon! After seeing how much work you've put in / how much work could be done for this and subsequent PRs, I think it's worth revisiting the amount of support that I can provide for the projector. Let me talk with my team a bit to see how much time I can reasonably expect to put into supporting / updating the projector in the near term!

@wchargin
Copy link
Contributor

Sounds good; thanks.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

ℹ️ Googlers: Go here for more info.

@wchargin
Copy link
Contributor

You can rebase master (which now includes #2052) to drop the cherry-pick
that Googlebot is complaining about.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

Copy link
Contributor

@wchargin wchargin left a comment

Choose a reason for hiding this comment

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

Looking good! Just one inline request and a few nits left. (I agree that
automated formatting would be great, but in the meantime let’s keep this
file consistent with its previous style and the rest of the codebase.)

Thanks for your patience! Should be ready to merge after these are addressed.

@cannoneyed
Copy link
Contributor Author

Thanks for taking the time for such a thorough review. What's the timeline look like for deployment once these changes are merged?

Copy link
Contributor

@wchargin wchargin left a comment

Choose a reason for hiding this comment

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

Thanks!

@wchargin
Copy link
Contributor

What's the timeline look like for deployment once these changes are
merged?

I’ll merge this into master, so it will be in tb-nightly starting
tonight. It’s a new feature, so it will be generally available in the
next minor version of TensorBoard: namely, TensorBoard 1.14.0, which
will roughly coincide with the TensorFlow 1.14.0 release.

@wchargin wchargin changed the title Add umap to embedding projector Add UMAP to embedding projector Mar 26, 2019
@wchargin wchargin merged commit 37c5b50 into tensorflow:master Mar 26, 2019
wchargin added a commit that referenced this pull request Apr 3, 2019
Summary:
This reverts commit 37c5b50. Manual
merge of `third_party/js.bzl` was required due to #2079; the file is now
identical to its state prior to #1901.

This is a temporary measure to keep our GitHub-to-Google sync process
green while we work on integrating the `umap-js` library into google3.

Test Plan:
The embeddings projector now lacks a UMAP option, but still works.

wchargin-branch: revert-1901
wchargin added a commit that referenced this pull request Apr 3, 2019
Summary:
This reverts commit 37c5b50. Manual
merge of `third_party/js.bzl` was required due to #2079; the file is now
identical to its state prior to #1901.

This is a temporary measure to keep our GitHub-to-Google sync process
green while we work on integrating the `umap-js` library into google3.

Test Plan:
The embeddings projector now lacks a UMAP option, but still works.

wchargin-branch: revert-1901
cannoneyed added a commit to cannoneyed/tensorboard that referenced this pull request Apr 11, 2019
wchargin pushed a commit that referenced this pull request Apr 17, 2019
This reverts commit 58df24b.

Other than the reversion, the only changes are non-functional: the UMAP
mirror URL is changed (but the sha256 of its contents is not), and a
license header is changed from “Google Inc.” to “Google LLC”.

Test Plan:
As in #1901.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants