question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom embedding initialization

See original GitHub issue

Looking at the embedding initialization options, I see ‘random’ and ‘spectral’. Would it be possible to initialize with a custom embedding? And if so, would this embedding be at all preserved?

In trying to compare the effect of different parameter changes, it could be helpful to use the embedding of a previous run as the initialization to a new UMAP instance with slightly different parameters. For example, these two min_dist values result in embeddings with different global orientations but similar local relationships.

download download-5

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kylemcdonaldcommented, Nov 17, 2017

great! it works!

the only hurdle i had to get across: t-SNE tends towards larger embeddings than umap. for example, t-SNE with default parameters embeds MNIST into a +/-35 range while UMAP is closer to +/-15. so initializing with the raw output of t-SNE produces some minor artifacts. once i scale the t-SNE output closer to the UMAP output it works better.

some gifs for your trouble:

https://www.dropbox.com/s/wbv73swh6qlrexg/mnist-all-init-0.8.gif?dl=0

this one is UMAP with min_dist=0.8 and initialized with a t-SNE embedding scaled by 0.4.

https://www.dropbox.com/s/cufrbjsbm79a3kh/mnist-all-init.gif?dl=0

this one is UMAP with default parameters also initialized with a t-SNE embedding scaled by 0.4.

the final embeddings of both are normalized uniformly across both axes to fill the screen with a little padding.

2reactions
lmcinnescommented, Nov 13, 2017

That’s a great idea for making the comparison clear. It certainly raises the priority on getting the custom initialisation done!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keras initialize large embeddings layer with pretrained ...
I am trying to re-train a word2vec model in Keras 2 with Tensorflow backend by using pretrained embeddings and custom ...
Read more >
Embedding — PyTorch 1.13 documentation
A simple lookup table that stores embeddings of a fixed dictionary and size. This module is often used to store word embeddings and...
Read more >
A Custom Embedding Layer for Numeric Input for PyTorch
I've been exploring the idea of applying TA to tabular data. The problem is that in NLP all inputs are integers that represent...
Read more >
Word embeddings | Text - TensorFlow
This tutorial contains an introduction to word embeddings. You will train your own word embeddings using a simple Keras model for a sentiment...
Read more >
Embedding layer - Keras
Embedding class · input_dim: Integer. · output_dim: Integer. · embeddings_initializer: Initializer for the embeddings matrix (see keras. · embeddings_regularizer: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found