CapsNet-pytorch
This repo aims to implement a "Dynamic Routing Between Capsules"paper
Requirements
- python 3
- Pytorch 0.4
- torchvision
- numpy
- tensorflow
TODO
- Network building
- Training on MNIST
- Training visualization(on Tensorboard)
- Training on MultiMNIST
- Weight load and inference
- Reconstruction at test time
- Reconstructed sample visualization(Training only now)
- Results reproduce and report on README.md
Usage
For training, use following command.
See details in trainer.py to modify the hyper-params or --help will let you know
$ python trainer.py --cuda
Use CUDA_VISIBLE_DEVICES=$GPU, if you want to select GPU devices
$ CUDA_VISIBLE_DEVICES=0 python trainer.py --cuda
or try this. if you don't want to use GPU
$ python trainer.py
If you want to see visualization of training and reconstruction samples,
$ Tensorboard --log='visual/' --port=6666
and go to 'localhost:6666' on webbrowser. You can see the Loss, Acc and Images.
References
- Another pytorch implementation
- Tensorflow implementation
- Blog post: Understanding capsnet
- Video: CapsNet tutorial
- This is best of best explanation in my mind