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 collections import OrderedDict | |
import numpy as np | |
import theano | |
import theano.tensor as T | |
from theano.ifelse import ifelse | |
def cg(loss, params, x0=None, max_iters=100, precondition=None, tol=1e-3, | |
conv_crit='cg'): | |
"""(Preconditioned) Conjugate Gradient (CG) updates |
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 lasagne | |
import theano | |
from lasagne import init | |
from lasagne import nonlinearities | |
from lasagne.layers import get_all_layers | |
from lasagne.layers import ( | |
NonlinearityLayer, BiasLayer, | |
DropoutLayer, GaussianNoiseLayer, |