Coder Social home page Coder Social logo

capsulenet_tf's Introduction

Capsule Networks

Implemented using TensorFlow
Based on the paper "Dynamic Routing Between Capsules"

Requirements

  • python3
  • TensorFlow
  • NumPy
  • Matplotlib

Dataset

  • MNIST datasets You can download at download link and locate them in the './MNIST_data' directory.

How to run Training & Testing

Locate the MNIST datasets in the './MNIST_data' directory and just run capsNet.ipynb



Results

Accuracy

  • The best error
% Training Validation Test
Implemented 0.0273 0.641 0.6611
Paper - - 0.25

The performance measurement was done with a CapsNet with 3 routing iterations and reconstruction.

Sample MNIST Test Reconstruction

Reconstructions with less training(1 epoch)



Reconstructions with more trained(50 epoch)

  • Sample MNIST test reconstructions of a CapsNet with 3 routing iterations.
  • The images on the first row are the input images, and that on the second row are the reconstructions.
  • We can see that the reconstructions preserves many of the details of the input while smoothing the noise.
  • We can get more detailed reconstruction with more traind model.

What the individual dimensions of a capsule represent

  • We can see what the individual dimensions represent by feeding a perturbed version of the activity vector to the decoder network and see how the perturbation affects the reconstruction.
  • By the experiment, the representations of each dimension can be translated as follows.
  • The dimension of the DigitCaps representation is tweaked by intervals of 0.05 in the range [โˆ’0.25, 0.25].
  • Localized skew

  • Scale of thickness

  • Width

capsulenet_tf's People

Contributors

myeong-yeon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.