Skip to content

Instantly share code, notes, and snippets.

'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import keras
#from keras.datasets import mnist
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uchidama
uchidama / imdb_prediction_in_keras.ipynb
Created February 4, 2018 14:13
IMDB Prediction in Keras.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uchidama
uchidama / keras_cifar10_viewer.ipynb
Created February 10, 2018 19:22
CIFAR-10 pictures viewer using keras.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uchidama
uchidama / keras_cifar10_webcam_prediction.ipynb
Last active February 11, 2018 05:07
Prediction a webcamera photo by a neaural network that is trained by CIFAR-10 datas.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uchidama
uchidama / keras_cifar10_webcam_prediction.ipynb
Last active February 11, 2018 05:04
Prediction a webcamera photo by a neaural network that is trained by CIFAR-10 datas.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uchidama
uchidama / keras_VGG16_predict_webcam_photo.ipynb
Last active February 12, 2018 16:04
Prediction a webcamera photo by a VGG16 model.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uchidama
uchidama / keras_VGG16_predict_webcam_photo.ipynb
Created February 12, 2018 16:27
Prediction a webcamera photo by a VGG16 model.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uchidama
uchidama / mnist_to_jpg.py
Last active March 14, 2022 01:25
Convert mnist binary on keras datasets to jpeg images.
import keras
from keras.datasets import mnist
import numpy as np
from PIL import Image, ImageOps
import os
def save_image(filename, data_array):
im = Image.fromarray(data_array.astype('uint8'))
im_invert = ImageOps.invert(im)