Coder Social home page Coder Social logo

kerasmnist's Introduction

Keras MNIST

cnn.py training based on keras mnist_cnn.py
cnnPredict.py inference based on Flask app.py
cnn.h5 pretrained Keras model

TFKeras is based on simplified MNIST For ML Beginners and cnn.py.
TFKeras.py, TFKeras.h5 & TFKpredict only uses Dense and so is less accurate than CNN.
TFKpredict is a slimmed version of cnnPredict.

TFKeras is 92% accurate vs CNN 99.25%
CNN can detect digit 1 better.

Keras.js MNIST CNN Demo

Code Documentation:

  • batch_size number of images per loop step
  • epochs number of train loops
  • num_classes there are 10 digits 0-9
  • x_train.astype('float32') trains faster than int
  • x_train /= 255 from 0-255 to 0-1
  • verbose=1 1 for progress bar logging
  • imread('test3.png',mode='L') โ€˜Lโ€™ (8-bit pixels, black and white)

kerasDataset.py equivalent to TFKeras.py using the keras dataset rather than the tensorflow dataset.
KerasTFDataset.py simplified example of TFKeras.py
jupyter.py has matplotlib and colab examples.

Keras Documentation:

Install

Tensorflow:

sudo pip install -U pip  
sudo pip install tensorflow 

Keras:

sudo apt update 
sudo apt install python-dev 
sudo pip install keras

Save Model:

sudo pip install h5py

imread:

sudo pip install pillow 

disable "cpu_feature_guard":
export TF_CPP_MIN_LOG_LEVEL=2

kerasmnist's People

Contributors

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