Using Tensorboard Embeddings Visualiser with Numpy Arrays

Tensorboard’s embeddings visualiser is great. You can use it to visualise and explore any set of high dimensional vectors (say, the activations of a hidden layer of a neural net) in a lower-dimensional space.

Tensorboard embedding visualiser in action

Often though, I’ve found it to be a bit of a pain to integrate saving the embeddings correctly into my model training code. Plus there are plenty of non-Tensorflow-based vectors that I’d like to be able to easily visualise through this tool.

So I decided to throw together a function save_embeddings() that takes the hassle out of this, allowing you to go straight from numpy arrays to Tensorboard-visualised embeddings. You can find the code here. Enjoy!

(Thanks to this Pinch of Intelligence post for some useful code snippets that I re-used for this).