#Copyright (C) 2010 Roland Memisevic # #This program is distributed WITHOUT ANY WARRANTY; without even the implied #warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #LICENSE file for more details. # #see the bottom of file for code that instantiates and trains a model # import numpy import pylab import factored_gbm def dispims(M, height, width, border=0, bordercolor=0.0, **kwargs): """ Display the columns of matrix M in a montage. """ numimages = M.shape[1] n0 = numpy.int(numpy.ceil(numpy.sqrt(numimages))) n1 = numpy.int(numpy.ceil(numpy.sqrt(numimages))) im = bordercolor*\ numpy.ones(((height+border)*n1+border,(width+border)*n0+border),dtype='