All Projects → moskomule → anatome

moskomule / anatome

Licence: MIT license
Ἀνατομή is a PyTorch library to analyze representation of neural networks

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to anatome

Semantic Embeddings
Hierarchy-based Image Embeddings for Semantic Image Retrieval
Stars: ✭ 196 (+292%)
Mutual labels:  representation-learning
PLBART
Official code of our work, Unified Pre-training for Program Understanding and Generation [NAACL 2021].
Stars: ✭ 151 (+202%)
Mutual labels:  representation-learning
Representation-Learning-for-Information-Extraction
Pytorch implementation of Paper by Google Research - Representation Learning for Information Extraction from Form-like Documents.
Stars: ✭ 82 (+64%)
Mutual labels:  representation-learning
Pytorch Byol
PyTorch implementation of Bootstrap Your Own Latent: A New Approach to Self-Supervised Learning
Stars: ✭ 213 (+326%)
Mutual labels:  representation-learning
Link Prediction
Representation learning for link prediction within social networks
Stars: ✭ 245 (+390%)
Mutual labels:  representation-learning
DESOM
🌐 Deep Embedded Self-Organizing Map: Joint Representation Learning and Self-Organization
Stars: ✭ 76 (+52%)
Mutual labels:  representation-learning
Vae vampprior
Code for the paper "VAE with a VampPrior", J.M. Tomczak & M. Welling
Stars: ✭ 173 (+246%)
Mutual labels:  representation-learning
PC3-pytorch
Predictive Coding for Locally-Linear Control (ICML-2020)
Stars: ✭ 16 (-68%)
Mutual labels:  representation-learning
Good Papers
I try my best to keep updated cutting-edge knowledge in Machine Learning/Deep Learning and Natural Language Processing. These are my notes on some good papers
Stars: ✭ 248 (+396%)
Mutual labels:  representation-learning
object-aware-contrastive
Object-aware Contrastive Learning for Debiased Scene Representation (NeurIPS 2021)
Stars: ✭ 44 (-12%)
Mutual labels:  representation-learning
Paddlehelix
Bio-Computing Platform featuring Large-Scale Representation Learning and Multi-Task Deep Learning “螺旋桨”生物计算工具集
Stars: ✭ 213 (+326%)
Mutual labels:  representation-learning
Contrastive Predictive Coding Pytorch
Contrastive Predictive Coding for Automatic Speaker Verification
Stars: ✭ 223 (+346%)
Mutual labels:  representation-learning
pgdl
Winning Solution of the NeurIPS 2020 Competition on Predicting Generalization in Deep Learning
Stars: ✭ 36 (-28%)
Mutual labels:  representation-learning
Awesome Network Embedding
A curated list of network embedding techniques.
Stars: ✭ 2,379 (+4658%)
Mutual labels:  representation-learning
Revisiting-Contrastive-SSL
Revisiting Contrastive Methods for Unsupervised Learning of Visual Representations. [NeurIPS 2021]
Stars: ✭ 81 (+62%)
Mutual labels:  representation-learning
Variational Ladder Autoencoder
Implementation of VLAE
Stars: ✭ 196 (+292%)
Mutual labels:  representation-learning
COCO-LM
[NeurIPS 2021] COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretraining
Stars: ✭ 109 (+118%)
Mutual labels:  representation-learning
image embeddings
Using efficientnet to provide embeddings for retrieval
Stars: ✭ 107 (+114%)
Mutual labels:  representation-learning
VQ-APC
Vector Quantized Autoregressive Predictive Coding (VQ-APC)
Stars: ✭ 34 (-32%)
Mutual labels:  representation-learning
Supervised-Contrastive-Learning-in-TensorFlow-2
Implements the ideas presented in https://arxiv.org/pdf/2004.11362v1.pdf by Khosla et al.
Stars: ✭ 117 (+134%)
Mutual labels:  representation-learning

anatome

Ἀνατομή is a PyTorch library to analyze internal representation of neural networks

This project is under active development and the codebase is subject to change.

v0.0.5 introduces significant changes to distance.

Installation

anatome requires

Python>=3.9.0
PyTorch>=1.10
torchvision>=0.11

After the installation of PyTorch, install anatome as follows:

pip install -U git+https://github.com/moskomule/anatome

Available Tools

Representation Similarity

To measure the similarity of learned representation, anatome.SimilarityHook is a useful tool. Currently, the following methods are implemented.

import torch
from torchvision.models import resnet18
from anatome import Distance

random_model = resnet18()
learned_model = resnet18(pretrained=True)
distance = Distance(random_model, learned_model, method='pwcca')
with torch.no_grad():
    distance.forward(torch.randn(256, 3, 224, 224))

# resize if necessary by specifying `size`
distance.between("layer3.0.conv1", "layer3.0.conv1", size=8)

Loss Landscape Visualization

from torch.nn import functional as F
from torchvision.models import resnet18
from anatome import landscape2d

x, y, z = landscape2d(resnet18(),
                      data,
                      F.cross_entropy,
                      x_range=(-1, 1),
                      y_range=(-1, 1),
                      step_size=0.1)
imshow(z)

Fourier Analysis

  • Yin et al. NeurIPS 2019 etc.,
from torch.nn import functional as F
from torchvision.models import resnet18
from anatome import fourier_map

map = fourier_map(resnet18(),
                  data,
                  F.cross_entropy,
                  norm=4)
imshow(map)

Citation

If you use this implementation in your research, please cite as:

@software{hataya2020anatome,
    author={Ryuichiro Hataya},
    title={anatome, a PyTorch library to analyze internal representation of neural networks},
    url={https://github.com/moskomule/anatome},
    year={2020}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].