Skip to content

Instantly share code, notes, and snippets.

View 3dimaging's full-sized avatar
🎯
Focusing

Weizhe Li 3dimaging

🎯
Focusing
View GitHub Profile
@3dimaging
3dimaging / googlenet.py
Created September 10, 2018 19:11 — forked from joelouismarino/googlenet.py
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):
@3dimaging
3dimaging / sgdr.py
Created September 17, 2018 19:10 — forked from jeremyjordan/sgdr.py
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
```python
schedule = SGDRScheduler(min_lr=1e-5,