From f281ab8bc13864773b8976d6fb35362415ce8f6b Mon Sep 17 00:00:00 2001 From: "junbo.chenjb" Date: Thu, 28 May 2015 15:39:14 +0800 Subject: [PATCH 1/2] add comments for show_examples.py --- pylearn2/scripts/show_examples.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/pylearn2/scripts/show_examples.py b/pylearn2/scripts/show_examples.py index cb7aad6e95..9aab47c701 100755 --- a/pylearn2/scripts/show_examples.py +++ b/pylearn2/scripts/show_examples.py @@ -1,8 +1,6 @@ #!/usr/bin/env python """ -.. todo:: - - WRITEME +Visualizes the examples in a dataset """ from __future__ import print_function @@ -22,22 +20,27 @@ def show_examples(path, rows, cols, rescale='global', out=None): """ - .. todo:: - - WRITEME + Show or save examples to an image for a pickled/YAML dataset Parameters ---------- path : string The pickle or YAML file to show examples of rows : int - WRITEME + Number of rows shown in the output image cols : int - WRITEME - rescale : {'rescale', 'global', 'individual'} - Default is 'rescale', WRITEME + Number of columns shown in the output image + rescale : {'none', 'global', 'individual'} + Default is 'global' + If 'none', no rescale is performed + If 'global', the examples is rescaled by the maximum absolute value + of a pixel in all the examples + If 'individual', the examples is rescaled by the maximum absolute + value of a pixel in each of the examples out : string, optional - WRITEME + Default is None + If None, the output image is opened by $PYLEARN2_VIEWER_COMMAND + Else, the output image is saved to the file named by $out """ if rescale == 'none': From af09ce17a3f89920ab27165052d324a6558fc1e4 Mon Sep 17 00:00:00 2001 From: Junbo Chen Date: Thu, 28 May 2015 16:29:44 +0800 Subject: [PATCH 2/2] fix pep8 error: unexpected indentation --- pylearn2/scripts/show_examples.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylearn2/scripts/show_examples.py b/pylearn2/scripts/show_examples.py index 9aab47c701..bd0007851a 100755 --- a/pylearn2/scripts/show_examples.py +++ b/pylearn2/scripts/show_examples.py @@ -34,9 +34,9 @@ def show_examples(path, rows, cols, rescale='global', out=None): Default is 'global' If 'none', no rescale is performed If 'global', the examples is rescaled by the maximum absolute value - of a pixel in all the examples + of a pixel in all the examples If 'individual', the examples is rescaled by the maximum absolute - value of a pixel in each of the examples + value of a pixel in each of the examples out : string, optional Default is None If None, the output image is opened by $PYLEARN2_VIEWER_COMMAND