Skip to content

Get 99.13% test accuracy MNIST with only 300 lines of code CNN by JAVA

License

Notifications You must be signed in to change notification settings

nthoangcute/tinyCNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tinyCNN

Very simple convolutional neural network by Java

INSTALLING

Download the MNIST or EMNIST dataset from here.

Change your path in trainFile and testFile.

  public String trainFile = "/home/vietbt/java/mnist_digits_train.txt";
  public String testFile = "/home/vietbt/java/mnist_digits_test.txt";
  public double learningRate = 0.55;
  public int batchSize = 50;
  public int outputSize = 10;

You also can config the learningRate, batchSize or outputSize to match your dataset. More information about MNIST or EMNIST datasets is in here. After that, run this code with your Java IDE or by linux command line:

  javac tinyCNN.java
  java tinyCNN

PERFORMANCE

This program runs with all CPUs (updated).

MNIST Digits Dataset

  • Best test accuracy: 99.13% with learning rate = 0.55 after 142,500 steps

EMNIST Digits Dataset

  • Best test accuracy: 98.58% with learning rate = 0.87 after 60,200 steps

EMNIST Letters Dataset

  • Best test accuracy: 88.56% with learning rate = 0.6 after 63,100 steps

EMNIST Balanced Dataset

  • Best test accuracy: 83.81% with learning rate = 0.6 after 117,300 steps

EMNIST By_Merge Dataset

  • Best train accuracy: 82.18% with learning rate = 0.85 after 191,300 steps
  • Best test accuracy: 80.13% with learning rate = 0.85 after 160,000 steps

EMNIST By_Class Dataset

  • Best train accuracy: 87.00% with learning rate = 0.85 after 206,900 steps
  • Best test accuracy: 85.73% with learning rate = 0.85 after 210,000 steps

AUTHOR

Bui The Viet - FPT University - [email protected]

About

Get 99.13% test accuracy MNIST with only 300 lines of code CNN by JAVA

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages