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
""" | |
A deep neural network with or w/o dropout in one file. | |
""" | |
import numpy, theano, sys, math | |
from theano import tensor as T | |
from theano import shared | |
from theano.tensor.shared_randomstreams import RandomStreams | |
from collections import OrderedDict |
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
""" | |
Functions to create network diagrams from a list of Layers. | |
Examples: | |
Draw a minimal diagram to a pdf file: | |
layers = lasagne.layers.get_all_layers(output_layer) | |
draw_to_file(layers, 'network.pdf', output_shape=False) | |
Draw a verbose diagram in an IPython notebook: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Alec Radford, Indico, Kyle Kastner | |
# License: MIT | |
""" | |
Convolutional VAE in a single file. | |
Bringing in code from IndicoDataSolutions and Alec Radford (NewMu) | |
Additionally converted to use default conv2d interface instead of explicit cuDNN | |
""" | |
import theano | |
import theano.tensor as T | |
from theano.compat.python2x import OrderedDict |
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.layers import Layer | |
class HighwayLayer(Layer): | |
def __init__(self, incoming, layer_class, gate_nonlinearity=None, | |
**kwargs): | |
super(HighwayLayer, self).__init__(incoming) | |
self.H_layer = layer_class(incoming, **kwargs) | |
if gate_nonlinearity: |
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
# Usage: experiment.sh SOURCE_FILE LOG_COMMIT_MESSAGE | |
if [ $# -eq 0 ] | |
then | |
echo "Usage: experiment.sh SOURCE_FILE [LOG_COMMIT_MESSAGE]" | |
exit -1 | |
fi | |
if [ $# -eq 2 ] | |
then |
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
require 'optim' | |
cj = require('cjson') | |
a = torch.Tensor({0.1,0.2,0.3}) | |
x0 = torch.Tensor({1, 1, 1}) | |
function f(x) | |
return torch.sum(torch.cmul(a, torch.pow(x, 2))) | |
end |
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
name: "CIFAR10_full" | |
input: "data" | |
input_shape { | |
dim: 1 | |
dim: 3 | |
dim: 32 | |
dim: 32 | |
} | |
layers { | |
name: "conv1" |
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 numpy as np | |
import gc | |
import memory_profiler | |
import theano | |
import theano.tensor as T | |
from theano.sandbox.cuda.dnn import dnn_conv | |
X = T.tensor4() | |
W = T.tensor4() |
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.layers import InputLayer | |
from lasagne.layers import DenseLayer | |
from lasagne.layers import ConcatLayer | |
from lasagne.layers import NonlinearityLayer | |
from lasagne.layers import GlobalPoolLayer | |
from lasagne.layers.dnn import Conv2DDNNLayer as ConvLayer | |
from lasagne.layers.dnn import MaxPool2DDNNLayer as PoolLayerDNN | |
from lasagne.layers import MaxPool2DLayer as PoolLayer | |
from lasagne.layers import LocalResponseNormalization2DLayer as LRNLayer | |
from lasagne.nonlinearities import softmax, linear |
OlderNewer