import os HOME = os.environ['HOME'] datadir = HOME+'/research/data/cifar/cifar-10-batches-py' import numpy import numpy.random import pylab #import dA import cA import train import theano import theano.tensor as T from theano.tensor.shared_randomstreams import RandomStreams numclasses = 10 numtrain = 50000 numtest = 10000 patchsize = 6 border = patchsize/2 numhid = 100 pooling = "everywhere" def dispims(M, height, width, border=0, bordercolor=0.0, layout=None, **kwargs): """ Display a whole stack (colunmwise) of vectorized matrices. Useful eg. to display the weights of a neural network layer. """ numimages = M.shape[1] if layout is None: n0 = int(pylab.ceil(numpy.sqrt(numimages))) n1 = int(pylab.ceil(numpy.sqrt(numimages))) else: n0, n1 = layout im = bordercolor * numpy.ones(((height+border)*n0+border,(width+border)*n1+border),dtype='