GithubHelp home page GithubHelp logo

tf_capsnet's Introduction

A tensorflow implementation for CapsNet

Network configuration

According to Hinton's paper Dynamic Routing Between Capsules

Train your model

python main.py

you can switch the is_multi_mnist to change the training set between Mnist and MultiMnist

Classification result on Mnist

batch_size = 64, lr = 0.001, beta1 = 0.9, decay_freq = 2k steps, min_lr = 1e-6, after 10k+ steps

is_shift_augmentation = True

image image

Results on MultiMnist

is_shift_agumentation = False

  • classification

batch_size = 128, lr = 0.001, beta1 = 0.9, after 30k+ training steps

image

  • segmenting

batch_size = 64, lr = 0.001, beta1 = 0.9, decay_freq = 2k steps, min_lr = 1e-6, after 10k+ steps

Here are some images showing the results of segmenting highly overlapping digits:

  • image generation condition on class

I generated some images from random DigitCapsule vectors near the unit sphere :

as we can see, it's not so real, but the pervious images show good results. and notice that Figure 4 in the paper is reconstructed from the neighbourhood of real images' embeding, this may mean that the real images didn't fill all the region around the unit sphere. I think this is due to the autoencoder regularization but not the VAE regularization.

Notice

  • The accuracy metric on MultiMnist may be different from the paper
  • Better results will be got if we run more iterations
  • The error rate on test set as showed in figures is only evaluated on one random varing test batch, but not the whole test set.

tf_capsnet's People

Contributors

laodar avatar laodar9 avatar tiger6998 avatar

Watchers

 avatar  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.