Skip to content

Instantly share code, notes, and snippets.

@samithaj
samithaj / mem-ts-RNN.py
Created June 16, 2018 17:36 — forked from lukovkin/mem-ts-RNN.py
Memory-efficient training of RNNs (modified example) - see https://groups.google.com/forum/#!topic/keras-users/vnGMtKPu1Xc for the discussion
# Code for Jupyter/IPython Notebook environment
from keras.models import Sequential
from keras.layers.core import TimeDistributedDense, Activation, Dropout
from keras.layers.recurrent import GRU
import numpy as np
from keras.utils.layer_utils import print_layer_shapes
%matplotlib inline
import matplotlib.pyplot as plt
@samithaj
samithaj / hyperband.py
Created November 26, 2019 11:48 — forked from PetrochukM/hyperband.py
Here we implement hyperband and successive halving adaptions. We found that the original hyperband implementation was messy and not tested. We also wanted to adapt it to include model reuse.
"""
We implement additional hyperparameter optimization methods not present in
https://scikit-optimize.github.io/.
Gist: https://gist.github.com/Deepblue129/2c5fae9daf0529ed589018c6353c9f7b
"""
import math
import logging
import random