Skip to content

qbxlvnf11/tsne-graph-nodes-neighbors-pytorch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

- t-SNE for graph nodes neighbors

  • t-SNE learns a two-dimensional embedding vector that preserves a certain neighboring structure of data represented as a high-dimensional vector, and expresses high-dimensional data as a two-dimensional map.
  • We add two py files (get_neighbor_index.py, select_feature.py) to get neighbors index list of target node and select embedding vector appropriated for index list.
  • Plot the x-axis and y-axis of t-SNE classified labels

- Examples

Contents

- get_neighbor_index.py

  • Save neighbors index list txt of target node using NetworkX

- select_feature.py

  • Select embedding vector apropriated to index list
  • index_text mode: read index list txt, index_range mode: set range of index list

- tsne_torch.py

  • Read feature vectors & labels and learning t-SNE
  • Plot axies of t-SNE
  • Using CUDA tensor

- Order of execution: get_neighbor_index.py -> select_feature.py -> tsne_torch.py

How to use

python get_neighbor_index.py --target_node u27192 --hop 1
python select_feature.py --index_text 1
python tsne_torch.py --max_iter 1000

Datasets

- Amazon-Book Dataset

https://jmcauley.ucsd.edu/data/amazon/

References

- NetworkX Library

https://networkx.github.io/documentation/stable/index.html

- t-SNE Pytorch

https://github.com/mxl1990/tsne-pytorch

- sklearn t-SNE

https://github.com/qbxlvnf11/machine-learning-basic/blob/master/Character-level_Word-level_t-SNE.ipynb

Author

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%