https://github.com/ayushidalmia/tsne-tensorboard-visualisation
This repository provides a starter code for using tensorboard via tensorflow for visualising embeddings
https://github.com/ayushidalmia/tsne-tensorboard-visualisation
embeddings representation tensorboard tensorflow visualisation
Last synced: about 1 year ago
JSON representation
This repository provides a starter code for using tensorboard via tensorflow for visualising embeddings
- Host: GitHub
- URL: https://github.com/ayushidalmia/tsne-tensorboard-visualisation
- Owner: ayushidalmia
- Created: 2017-04-21T12:16:49.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-04T12:01:49.000Z (about 8 years ago)
- Last Synced: 2025-04-30T04:48:39.407Z (about 1 year ago)
- Topics: embeddings, representation, tensorboard, tensorflow, visualisation
- Language: Python
- Size: 16.7 MB
- Stars: 14
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tf-tb-visualisation
### How to run
This repository provides a starter code for using tensorboard via tensorflow for visualising embeddings
The following is the folder structure expected by the code:
* sample_data/
* embeddings/
* filename_embedding
* images/
* data/
* metadata.txt
* text/
* metadata.txt
The filename_embedding consists of the n_dimensional embeddings
The data folder consists of all the images
The metadata.txt for images consists of the following format: image_filename\tlabel (one to one mapping with embedding vector)
The metadata.txt for text consists of the following format: label (one to one mapping with embedding vector)
For visualising embeddings run the following from the command line:
For word embeddings:
```
python visualise_embeddings.py -b $baseDir -f $filename_embedding -m "text" -l $filename_label
```
Example usage:
```
python visualise_embeddings.py -b /Users/ayushi/Work/tf-tb-visualisation/sample_data/ -f feature_vectors_400_samples.txt -m text -l metadata_text.txt
```
For image embeddings:
```
python visualise_embeddings.py -b $baseDir -f $filename_embedding -m "image" -l $filename_label
```
Example usage:
```
python visualise_embeddings.py -b /Users/ayushi/Work/tf-tb-visualisation/sample_data/ -f feature_vectors_400_samples.txt -m "image" -l metadata_images.txt
```
Then finally run:
```
tensorboard --logdir=$baseDir
```
Example usage:
```
tensorboard --logdir=/Users/ayushi/Work/tf-tb-visualisation/sample_data/
```
Note: Giving the complete path is important.
### Reading:
* [Visualizing Data using t-SNE](http://www.jmlr.org/papers/volume9/vandermaaten08a/vandermaaten08a.pdf)
* [How to use t-SNE efficiently](https://distill.pub/2016/misread-tsne/)
### Acknowledgement
I would like to sincerely thank [Anuj Shah](https://github.com/anujshah1003) for his data and code for sprite image.