This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lasagne import * | |
from lasagne.layers import * | |
from lasagne.random import get_rng | |
from lasagne.utils import * | |
import numpy as np | |
import theano.tensor as T | |
from theano.tensor.shared_randomstreams import RandomStreams | |
class DropoutLSTMLayer(MergeLayer): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import numpy as np | |
from matplotlib import pyplot as plt | |
from time import time | |
from foxhound import activations | |
from foxhound import updates | |
from foxhound import inits | |
from foxhound.theano_utils import floatX, sharedX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def adam(loss, all_params, learning_rate=0.001, b1=0.9, b2=0.999, e=1e-8, | |
gamma=1-1e-8): | |
""" | |
ADAM update rules | |
Default values are taken from [Kingma2014] | |
References: | |
[Kingma2014] Kingma, Diederik, and Jimmy Ba. | |
"Adam: A Method for Stochastic Optimization." | |
arXiv preprint arXiv:1412.6980 (2014). |