Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

kaparoo/Efficient-CapsNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EFFICIENT-CAPSNET: CAPSULE NETWORK WITH SELF-ATTENTION ROUTING

model_plot

Tensorflow 2.x (with Keras API) Implementation of the Efficient-CapsNet (Mazzia et al., 2021)

Training and Testing (MNIST)

Use

python main.py --checkpoint_dir=checkpoint --num_epochs=15
  • checkpoint: path to save trained weights of the model.
  • num_epochs: Number of epochs. You can resume any previous training.

You can also simplify

python main.py --flagfile=./flags.txt

Environment (Docker)

If you use Docker, the code has been verified to work on tensorflow/tensorflow:2.6.0-gpu.

  • Pull Image & Run container & Get into shell
docker run -it --rm --runtime=nvidia tensorflow/tensorflow:2.6.0-gpu bash
  • (In container) Install and Run code
# Install git
apt-get update
apt-get install git
git clone https://github.com/kaparoo/Efficient-CapsNet.git
cd Efficient-CapsNet

# Install matplotlib
pip install matplotlib

# Training
python main.py --checkpoint_dir=checkpoint --num_epochs=15

References

  • Efficient-CapsNet: Capsule Network with Self-Attention Routing (arXiv)
  • Official Code (GitHub)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages