Visualizing embeddings using t-SNE

Shashank Iyer
GSI Technology
Published in
3 min readOct 15, 2018

--

In this blog I will talk about using Tensorboard to view image embeddings and provide some visual examples of clustering using Clarifai’s embeddings.

Installing Tensorboard

Tensorboard is installed along with Tensorflow. Run the following command to install Tensorflow:

pip install tensorflow

Visualise Embeddings with Tensorboard

Tensorboard provides the ability to view embeddings on it’s Projector. Users may select either PCA, t-SNE or provide a custom algorithm to visualise embeddings. A few steps are to be followed to create the right files needed by the Projector.

Create a Tensorflow variable to store the embeddings. Configure a Projector object as shown below:

Steps to setup a projector

A metadata file is to be created to store the values of the embedding’s corresponding labels. Calling the Projector object’s visualise embeddings method makes it ready for the operation with the appropriate parameters passes. Finally, initialise and save the Tensorflow session as follows:

--

--

Shashank Iyer
GSI Technology

Engineer | Chef | Avid Reader | Lifelong Learner | Athlete