Code for Keras plays catch blog post
python qlearn.py- Generate figures
| from __future__ import print_function | |
| import imageio | |
| from PIL import Image | |
| import numpy as np | |
| import keras | |
| from keras.layers import Input, Dense, Conv2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, Concatenate, Reshape, Activation | |
| from keras.models import Model | |
| from keras.regularizers import l2 | |
| from keras.optimizers import SGD |
Code for Keras plays catch blog post
python qlearn.py| # Context manager to generate batches in the background via a process pool | |
| # Usage: | |
| # | |
| # def batch(seed): | |
| # .... # generate minibatch | |
| # return minibatch | |
| # | |
| # with BatchGenCM(batch) as bg: | |
| # minibatch = next(bg) | |
| # .... # do something with minibatch |
##VGG16 model for Keras
This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.
It has been obtained by directly converting the Caffe model provived by the authors.
Details about the network architecture can be found in the following arXiv paper:
Very Deep Convolutional Networks for Large-Scale Image Recognition
K. Simonyan, A. Zisserman
| import subprocess, itertools, numpy | |
| import matplotlib.pyplot as plt | |
| command = 'git log --shortstat --log-size --format=oneline --no-merges'.split() | |
| data = subprocess.check_output(command).split('\n') | |
| def read_groups(): | |
| buf = [] | |
| for line in data: | |
| buf.append(line) |