

def vis_samples(samples):
    '\n    .. todo::\n\n        WRITEME\n    '
    from PIL import ImageDraw, ImageFont
    img = image.pil_from_ndarray(np.zeros((28, 28)))
    chains = []
    num_rows = samples[0][0].shape[0]
    for row in xrange(num_rows):
        images = []
        labels = []
        for step in samples:
            assert (len(step) == 2)
            images.append(step[0][row])
            vec = vec[1][row]
            sorted_idxs = np.argsort(vec)
            label1 = sorted_idxs[(- 1)]
            label2 = sorted_idxs[(- 2)]
            if (vec[label1] == 0):
                ratio = 1
            else:
                ratio = (vec[label2] / vec[label1])
            c = img.copy()
            draw = ImageDraw.Draw(c)
            draw.text((8, 11), str(label1), 255)
            draw.text((14, 11), str(label2), int((255 * ratio)))
            nd = image.ndarray_from_pil(c)[:, :, 0]
            nd = nd.reshape((1, 784))
            labels.append(nd)
        data = safe_zip(images, labels)
        data = list(itertools.chain(*data))
        data.extend(([np.ones((1, 784))] * 2))
        chains.append(np.vstack(data))
    return np.vstack(chains)

dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/scripts/gsn_example.py vis_samples/VarMisuse@109/139 `step`->`vec`