Giter VIP home page Giter VIP logo

capsnet-character-tensorflow's Introduction

Introduction

A Tensorflow implementation of CapsNet based on Geoffrey Hinton's paper Dynamic Routing Between Capsules

The code was derive from naturomics/CapsNet-Tensorflow . To apply to the Chinese Character Recognization competions(**古汉字识别,或者成为书法识别比赛),I made some improvements.

  1. The parameters of original code edition are fixed, it is troublesome to change the conv layer's kernel size. Now you can set it casual.
  2. To improve the accuracy of Chinese Character, I add a more conv layer ,the shape of input_image is 64*64*1

Notes:

  1. The current version supports **书法识别 The current test accuracy for MNIST is 93.42%
  2. See dist_version for multi-GPU support

Requirements

  • Python
  • NumPy
  • Tensorflow>=1.3
  • tqdm (for displaying training progress info)
  • scipy (for saving images)

Usage

Step 1. Download this repository with git

$ git clone [email protected]:mixianbuguoqiao/CapsNet-Character-Tensorflow.git
$ cd CapsNet-Tensorflow

Step 2. Download Chinese-Character 123

Manual downloading with wget or other tools, move and extract dataset into data for example:

$ mkdir -p data

Step 3. Start the training(Using the MNIST dataset by default):

$ python main.py

$ or python main.py --dataset character
$ # If you need to monitor the training process, open tensorboard with this command
$ tensorboard --logdir=logdir

Step 4. Calculate test accuracy

$ python main.py --is_training=False
$ # for fashion-mnist dataset
$ python main.py --dataset fashion-mnist --is_training=False

Note: The default parameters of batch size is 1, and epoch 50. You may need to modify the config.py file or use command line parameters to suit your case, e.g. set batch size to 32 and do once test summary every 200 steps: python main.py --test_sum_freq=100 --batch_size=32

Reference

capsnet-character-tensorflow's People

Contributors

mixianbuguoqiao avatar

Watchers

 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.