Skip to content

Instantly share code, notes, and snippets.

View hitchhicker's full-sized avatar
🎯
Focusing

hitchhicker

🎯
Focusing
View GitHub Profile
@hitchhicker
hitchhicker / mnist_numpy.py
Created April 14, 2019 16:46
Implement a single neural network using numpy
import _pickle as cPickle
import gzip
import numpy as np
from sklearn.utils import shuffle
def load_data():
f = gzip.open('./data/mnist.pkl.gz', 'rb')
training_data, validation_data, test_data = cPickle.load(f, encoding='bytes')
@hitchhicker
hitchhicker / predict_image.py
Created March 28, 2018 21:07
Predict category given frozen model and image
import numpy as np
import tensorflow as tf
TEST_IMAGE_PATH = './glass17.jpg'
FROZEN_MODEL_PATH = './graph.pb'
INPUT_SIZE = 224
INDEX_2_LABEL = {
0: 'cardboard',
1: 'plastic',