Package pylearn :: Package io :: Module image_tiling
[hide private]

Module image_tiling

source code

Illustrate filters (or data) in a grid of small image-shaped tiles.

Functions [hide private]
 
scale_to_unit_interval(ndar, eps=1e-8) source code
 
tile_raster_images(X, img_shape, tile_shape, tile_spacing=(0,0), scale_rows_to_unit_interval=True, output_pixel_vals=True)
Transform an array with one flattened image per row, into an array in which images are reshaped and layed out like tiles on a floor.
source code

Imports: numpy, Image


Function Details [hide private]

tile_raster_images(X, img_shape, tile_shape, tile_spacing=(0,0), scale_rows_to_unit_interval=True, output_pixel_vals=True)

source code 

Transform an array with one flattened image per row, into an array in which images are reshaped and layed out like tiles on a floor.

This function is useful for visualizing datasets whose rows are images, and also columns of matrices for transforming those rows (such as the first layer of a neural net).

:type X: a 2-D ndarray or a tuple of 4 channels, elements of which can be 2-D ndarrays or None :param X: a 2-D array in which every row is a flattened image. :type img_shape: tuple; (height, width) :param img_shape: the original shape of each image :type tile_shape: tuple; (rows, cols) :param tile_shape: the number of images to tile (rows, cols)

:returns: array suitable for viewing as an image. (See:`PIL.Image.fromarray`.) :rtype: a 2-d array with same dtype as X.