项目作者: Yunski

项目描述 :
Comparing Traditional CNNs and Capsule Networks with Greebles Classification
高级语言: Python
项目地址: git://github.com/Yunski/capsnet-greebles.git
创建时间: 2017-12-21T22:06:01Z
项目社区:https://github.com/Yunski/capsnet-greebles

开源协议:

下载


cos429-capsnet

Comparing Traditional CNNs and Capsule Networks with Greebles Classification. \
Implementation of the capsule network is adapted from naturomics/CapsNet-Tensorflow.

Getting Started

Install anaconda or miniconda.
Then create the environment with conda.

  1. # Use TensorFlow with GPU
  2. $ conda env create -f environment-gpu.yml

Download data

Change the dataset flag in config.py as needed.
Run the following script to download and extract data files.

  1. $ python data.py

For affNIST and smallnorb, also run the scripts:

  1. $ python affnist.py
  2. $ python smallnorb.py

For Greebles, generate a greebles dataset with the script found at sherrybai/greebles-generator.
Extract the resulting zip file into the directory data/greebles.
Then, run the script:

  1. $ python greebles.py

Add a new entry to datasets.yml if you wish to test on another dataset not already included.

Training and Testing

Training a model:

  1. $ python {model}_train.py

Testing a model:

  1. $ python {model}_eval.py

i.e. python cnn_train.py

Logs and train/validation/test csv files can be found under logs/ and summary/. \
Visualize plots with tensorboard:

  1. $ tensorboard --logdir=logdir