Skip to content

PyTorch implementation of the paper Dynamic Routing Between Capsules by Sara Sabour, Nicholas Frosst and Geoffrey Hinton

License

Notifications You must be signed in to change notification settings

danielhavir/capsule-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Capsule Network

License

PyTorch implementation of the following paper:

Official implemenation

Visual represenation

capsules_visual_representation

Image source: Mike Ross, A Visual Representation of Capsule Network Computations

Run the experiment

  • For details, run python main.py --help

Example of reconstructed vs. original images

reconstructed


Requirements:

Default hyper-parameters (similar to the paper):

  • Per-GPU batch_size = 128
  • Initial learning_rate = 0.001
  • Exponential lr_decay = 0.96
  • Number of routing iteration (num_routing) = 3

Loss function hyper-parameters (see loss.py):

  • Lambda for Margin Loss = 0.5
  • Scaling factor for reconstruction loss = 0.0005

GPU Speed benchmarks:

(with above mentioned hyper-parameters)

  • Single GeForce GTX 1080Ti - 35.6s per epoch
  • Two GeForce GTX 1080Ti - 35.8s per epoch (twice the batch size -> half the iteration)

About

PyTorch implementation of the paper Dynamic Routing Between Capsules by Sara Sabour, Nicholas Frosst and Geoffrey Hinton

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages