Skip to content

Instantly share code, notes, and snippets.

View 3dimaging's full-sized avatar

Weizhe Li 3dimaging

View GitHub Profile
3dimaging /
Created September 17, 2018 19:10 — forked from jeremyjordan/
Keras Callback for implementing Stochastic Gradient Descent with Restarts
from keras.callbacks import Callback
import keras.backend as K
import numpy as np
class SGDRScheduler(Callback):
'''Cosine annealing learning rate scheduler with periodic restarts.
# Usage
schedule = SGDRScheduler(min_lr=1e-5,
3dimaging /
Created September 10, 2018 19:11 — forked from joelouismarino/
GoogLeNet in Keras
from scipy.misc import imread, imresize
from keras.layers import Input, Dense, Convolution2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, merge, Reshape, Activation
from keras.models import Model
from keras.regularizers import l2
from keras.optimizers import SGD
from googlenet_custom_layers import PoolHelper,LRN
def create_googlenet(weights_path=None):