import pylab import numpy import numpy.random import gatedAutoencoder import theano import theano.tensor as T from theano.tensor.shared_randomstreams import RandomStreams def dispims(M, height, width, border=0, bordercolor=0.0, layout=None, **kwargs): from pylab import cm, ceil numimages = M.shape[1] if layout is None: n0 = int(numpy.ceil(numpy.sqrt(numimages))) n1 = int(numpy.ceil(numpy.sqrt(numimages))) else: n0, n1 = layout im = bordercolor * numpy.ones(((height+border)*n0+border,(width+border)*n1+border),dtype='