This file contains hidden or 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 as nn | |
Conv2DLayer = nn.layers.Conv2DDNNLayer | |
def inception_module(l_in, num_1x1, reduce_3x3, num_3x3, reduce_5x5, num_5x5, gain=1.0, bias=0.1): | |
""" | |
inception module (without the 3x3s1 pooling and projection because that's difficult in Theano right now) | |
""" | |
shape = l_in.get_output_shape() | |
out_layers = [] |
This file contains hidden or 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
sedielem@koe:~/git/Theano/theano/sandbox/cuda/tests$ THEANO_FLAGS=warn_float64=ignore nosetests test_dnn.py | |
Using gpu device 1: Tesla K40c | |
.......... | |
---------------------------------------------------------------------- | |
Ran 10 tests in 218.306s | |
OK |
This file contains hidden or 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
sedielem@koe:~/git/Theano/theano/sandbox/cuda/tests$ nosetests test_dnn.py | |
Using gpu device 1: Tesla K40c | |
EEEEEESS.S | |
====================================================================== | |
ERROR: test_conv (theano.sandbox.cuda.tests.test_dnn.TestDnnInferShapes) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/sedielem/git/Theano/theano/sandbox/cuda/tests/test_dnn.py", line 259, in test_conv | |
dnn.GpuDnnConv | |
File "/home/sedielem/git/Theano/theano/tests/unittest_tools.py", line 237, in _compile_and_check |
This file contains hidden or 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
In [1]: import theano | |
Using gpu device 0: GeForce GT 540M | |
In [2]: import theano.tensor as T | |
In [3]: y = T.tensor4('y') | |
In [4]: f = theano.function([y], y) | |
In [5]: theano.printing.debugprint(y) |
This file contains hidden or 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
class GalaxyDivNormLayer(nntools.layers.Layer): | |
""" | |
rectification + divisive normalization | |
""" | |
def __init__(self, input_layer): | |
super(GalaxyDivNormLayer, self).__init__(input_layer) | |
self.question_slices = [slice(0, 3), slice(3, 5), slice(5, 7), slice(7, 9), slice(9, 13), slice(13, 15), | |
slice(15, 18), slice(18, 25), slice(25, 28), slice(28, 31), slice(31, 37)] |
This file contains hidden or 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 multiprocessing as mp | |
def buffered_gen_mp(source_gen, buffer_size=2): | |
""" | |
Generator that runs a slow source generator in a separate process. | |
buffer_size: the maximal number of items to pre-generate (length of the buffer) | |
""" | |
if buffer_size < 2: | |
raise RuntimeError("Minimal buffer size is 2!") |
This file contains hidden or 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
In [1]: import theano | |
iUsing gpu device 0: GeForce GTX 480 | |
m | |
In [2]: import theano.tensor as T | |
In [3]: x, y = T.matrices('x', 'y') | |
In [4]: prod = T.dot(x, y) | |
In [5]: f = theano.function([x,y], prod) |
This file contains hidden or 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
* GeForce GTX 780Ti "Superclocked" | |
* drivers 340.24 | |
* CUDA 6.5 | |
sander@sander-precision:~/tmp/schluter/Theano$ for x in full valid subsample grads; do cuda-memcheck nosetests theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py:test_gemm_$x; done | |
========= CUDA-MEMCHECK | |
Using gpu device 0: GeForce GTX 780 Ti | |
. | |
---------------------------------------------------------------------- |
This file contains hidden or 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
* GeForce GTX 780Ti "Superclocked" | |
* drivers 340.24 | |
* CUDA 6.0 | |
sander@sander-precision:~/tmp/schluter/Theano$ for x in full valid subsample grads; do cuda-memcheck nosetests theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py:test_gemm_$x; done | |
========= CUDA-MEMCHECK | |
Using gpu device 0: GeForce GTX 780 Ti | |
========= Invalid __global__ read of size 4 | |
========= at 0x000000e0 in sgemm_sm_heavy_nt_ldg |
This file contains hidden or 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
"""This tutorial introduces the LeNet5 neural network architecture | |
using Theano. LeNet5 is a convolutional neural network, good for | |
classifying images. This tutorial shows how to build the architecture, | |
and comes with all the hyper-parameters you need to reproduce the | |
paper's MNIST results. | |
This implementation simplifies the model in the following ways: | |
- LeNetConvPool doesn't implement location-specific gain and bias parameters |
NewerOlder