

def get_mapped_batch(dataset, design_batch):
    "\n    Get mapped batch if 'mapback_for_viewer' is available with the dataset.\n\n    Parameters\n    ----------\n    dataset: pylearn2 dataset\n    design_batch: numpy array\n    "
    if (design_batch.ndim != 2):
        design_batch = dataset.get_design_matrix(design_batch.copy())
    mapped_design = dataset.mapback(design_batch.copy())
    mapped_batch = dataset.get_topological_view(mapped_design.copy())
    return mapped_batch

dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/scripts/dbm/show_reconstructions.py get_mapped_batch/original