Skip to content

Instantly share code, notes, and snippets.

View Thimira's full-sized avatar

Thimira Amaratunga Thimira

View GitHub Profile
@Thimira
Thimira / lenet_mnist_keras.py
Last active February 27, 2018 13:27
Deep Learning Beginner Tutorial. Using the LeNet model on the MNIST dataset for handwritten digit recognition. Works with Keras v2 and TensorFLow. This code is part of the book Build Deeper: Deep Learning Beginners' Guide (https://www.amazon.com/dp/B07564Y6CL)
# How to use
#
# Train the model and save the model weights
# python lenet_mnist_keras.py --train-model 1 --save-trained 1
#
# Train the model and save the model wights to a give directory
# python lenet_mnist_keras.py --train-model 1 --save-trained 1 --weights data/lenet_weights.hdf5
#
# Evaluate the model from pre-trained model wights
# python lenet_mnist_keras.py