All Projects → adambielski → Capsnet Pytorch

adambielski / Capsnet Pytorch

Licence: bsd-3-clause
PyTorch implementation of NIPS 2017 paper Dynamic Routing Between Capsules

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Capsnet Pytorch

Capsnet
CapsNet (Capsules Net) in Geoffrey E Hinton paper "Dynamic Routing Between Capsules" - State Of the Art
Stars: ✭ 423 (-3.86%)
Mutual labels:  mnist, capsnet
Free Spoken Digit Dataset
A free audio dataset of spoken digits. Think MNIST for audio.
Stars: ✭ 396 (-10%)
Mutual labels:  mnist
CapsNet-keras-imdb
No description or website provided.
Stars: ✭ 15 (-96.59%)
Mutual labels:  capsnet
Capslayer
CapsLayer: An advanced library for capsule theory
Stars: ✭ 351 (-20.23%)
Mutual labels:  capsnet
minetorch
Build deep learning applications in a new and easy way.
Stars: ✭ 157 (-64.32%)
Mutual labels:  mnist
Mnist Svhn Transfer
PyTorch Implementation of CycleGAN and SSGAN for Domain Transfer (Minimal)
Stars: ✭ 369 (-16.14%)
Mutual labels:  mnist
Spatial-Transformer-Networks-with-Keras
This repository provides a Colab Notebook that shows how to use Spatial Transformer Networks inside CNNs in Keras.
Stars: ✭ 23 (-94.77%)
Mutual labels:  mnist
Mnist Android Tensorflow
Handwritten digits classification from MNIST with TensorFlow on Android; Featuring Tutorial!
Stars: ✭ 328 (-25.45%)
Mutual labels:  mnist
Medmnist
[ISBI'21] MedMNIST Classification Decathlon: A Lightweight AutoML Benchmark for Medical Image Analysis
Stars: ✭ 338 (-23.18%)
Mutual labels:  mnist
Capsnet Tensorflow
A Tensorflow implementation of CapsNet(Capsules Net) in paper Dynamic Routing Between Capsules
Stars: ✭ 3,776 (+758.18%)
Mutual labels:  capsnet
Cifar-Autoencoder
A look at some simple autoencoders for the Cifar10 dataset, including a denoising autoencoder. Python code included.
Stars: ✭ 42 (-90.45%)
Mutual labels:  mnist
Pytorch Mnist Celeba Cgan Cdcgan
Pytorch implementation of conditional Generative Adversarial Networks (cGAN) and conditional Deep Convolutional Generative Adversarial Networks (cDCGAN) for MNIST dataset
Stars: ✭ 290 (-34.09%)
Mutual labels:  mnist
Capsnet Visualization
🎆 A visualization of the CapsNet layers to better understand how it works
Stars: ✭ 371 (-15.68%)
Mutual labels:  capsnet
MNIST-invert-color
Invert the color of MNIST images with PyTorch
Stars: ✭ 13 (-97.05%)
Mutual labels:  mnist
Disentangling Vae
Experiments for understanding disentanglement in VAE latent representations
Stars: ✭ 398 (-9.55%)
Mutual labels:  mnist
WhiteBox-Part1
In this part, I've introduced and experimented with ways to interpret and evaluate models in the field of image. (Pytorch)
Stars: ✭ 34 (-92.27%)
Mutual labels:  mnist
Pytorch Mnist Celeba Gan Dcgan
Pytorch implementation of Generative Adversarial Networks (GAN) and Deep Convolutional Generative Adversarial Networks (DCGAN) for MNIST and CelebA datasets
Stars: ✭ 363 (-17.5%)
Mutual labels:  mnist
Tensorflow Mnist Vae
Tensorflow implementation of variational auto-encoder for MNIST
Stars: ✭ 422 (-4.09%)
Mutual labels:  mnist
Tensorflow Tutorial Samples
TensorFlow2教程 TensorFlow 2.0 Tutorial 入门教程实战案例
Stars: ✭ 398 (-9.55%)
Mutual labels:  mnist
Tensorflow Generative Model Collections
Collection of generative models in Tensorflow
Stars: ✭ 3,785 (+760.23%)
Mutual labels:  mnist

Dynamic Routing Between Capsules - PyTorch implementation

PyTorch implementation of NIPS 2017 paper Dynamic Routing Between Capsules from Sara Sabour, Nicholas Frosst and Geoffrey E. Hinton.

The hyperparameters and data augmentation strategy strictly follow the paper.

Requirements

Only PyTorch with torchvision is required (tested on pytorch 0.2.0 and 0.3.0). Jupyter and matplotlib is required to run the notebook with visualizations.

Usage

Train the model by running

python net.py

Optional arguments and default values:

  --batch-size N          input batch size for training (default: 128)
  --test-batch-size N     input batch size for testing (default: 1000)
  --epochs N              number of epochs to train (default: 250)
  --lr LR                 learning rate (default: 0.001)
  --no-cuda               disables CUDA training
  --seed S                random seed (default: 1)
  --log-interval N        how many batches to wait before logging training
                          status (default: 10)
  --routing_iterations    number of iterations for routing algorithm (default: 3)
  --with_reconstruction   should reconstruction layers be used

MNIST dataset will be downloaded automatically.

Results

The network trained with reconstruction and 3 routing iterations on MNIST dataset achieves 99.65% accuracy on test set. The test loss is still slightly decreasing, so the accuracy could probably be improved with more training and more careful learning rate schedule.

Visualizations

We can create visualizations of digit reconstructions from DigitCaps (e.g. Figure 3 in the paper)

Reconstructions

We can also visualize what each dimension of digit capsule represents (Section 5.1, Figure 4 in the paper).

Below, each row shows the reconstruction when one of the 16 dimensions in the DigitCaps representation is tweaked by intervals of 0.05 in the range [−0.25, 0.25].

Perturbations

We can see what individual dimensions represent for digit 7, e.g. dim6 - stroke thickness, dim11 - digit width, dim 15 - vertical shift.

Visualization examples are provided in a jupyter notebook

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].