This repository contains different positional embeddings for GraphDINO, that I have implemented during my lab rotation. Positional embeddings are organized by tags:
- pstepRWPE+euclPE - p-step random walk matrix and eigenvectors of euclidean distance matrix
- lapPE_only - eigenvectros of Laplacian matrix
- pstepRWPE_only - p-step random walk matrix
- eucl_disPE_only - eigenvectors of euclidean distance matrix
- cond_distPE_only - eigenvectors of conductance distance matrix
- allPE - all above positional embeddings combined
- with_cond_dist_in_GT - includes the previous version of positional embeddings, which were summed to node features instead of concatenating. Disregard this tag.
For model inference use Checkpoints_visualized.ipynb.
- Load the corresponding code using the tags above.
- Select the correct config file and change the paths to checkpoint files
- Uncomment the cell with the positional embedding(s)
- Change the CUDA device number in train.py line 10 to "cuda:0"; and in graphdino.py line 418 to "cuda:0"
- Run the notebook. It will give accuracy score, confusion matrix, and t-SNE clustering
Model weights are located in ckpts folder with the corresponding names
This repository contains code to the paper Self-supervised Representation Learning of Neuronal Morphologies by M.A. Weis, L. Pede, T. Lüddecke and A.S. Ecker (2021).
python3 setup.py install
Extract data using the Allen Software Development Kit. See demo notebook on how to use the Allen Cell Types Database.
See extract_allen_data.ipynb for data preprocessing.
Start training GraphDINO from scratch on ABA dataset:
python3 ssl_neuron/main.py --config=ssl_neuron/configs/config.json
For examples on how to load the data, train the model and perform inference with a pretrained model, see Jupyter notebooks in the demos folder.
If you use this repository in your research, please cite:
@article{Weis2021,
title={Self-supervised Representation Learning of Neuronal Morphologies},
author={Marissa A. Weis and Laura Pede and Timo Lüddecke and Alexander S. Ecker},
year={2021},
journal={arXiv}
}