Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add comments for show_examples.py #1531

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions pylearn2/scripts/show_examples.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
"""
.. todo::

WRITEME
Visualizes the examples in a dataset
"""
from __future__ import print_function

Expand All @@ -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':
Expand Down