提交 d451fc3b authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix d3viz doc errors.

上级 8d3a67b7
.. _libdoc_d3viz:
============================================================================
=========================================================================
:mod:`d3viz` -- d3viz: Interactive visualization of Theano compute graphs
============================================================================
=========================================================================
.. module:: d3viz
.. module:: theano.d3viz
:platform: Unix, Windows
:synopsis: Allows to interactively visualize Theano compute graphs
.. moduleauthor:: Christof Angermueller
......@@ -109,7 +109,7 @@ the the :py:mod:`theano.d3viz.d3viz` module, which can be called as before:
import theano.d3viz as d3v
d3v.d3viz(predict, 'examples/mlp.html')
`Open visualization! <../../_static/mlp.html>`_
`Open visualization! <../../_static/mlp.html>`__
When you open the output file ``mlp.html`` in your web-browser, you will
see an interactive visualization of the compute graph. You can move the
......@@ -150,7 +150,7 @@ random data:
d3v.d3viz(predict_profiled, 'examples/mlp2.html')
`Open visualization! <../../_static/mlp2.html>`_
`Open visualization! <../../_static/mlp2.html>`__
When you open the HTML file in your browser, you will find an additional
``Toggle profile colors`` button in the menu bar. By clicking on it,
......@@ -213,7 +213,7 @@ defines a nested graph, which will be visualized accordingly by
d3v.d3viz(f, 'examples/ofg.html')
`Open visualization! <../../_static/ofg.html>`_
`Open visualization! <../../_static/ofg.html>`__
In this example, an operation with three inputs is defined, which is
used to build a function that calls this operations twice, each time
......@@ -243,7 +243,7 @@ the following example.
d3v.d3viz(f, 'examples/ofg2.html')
`Open visualization! <../../_static/ofg2.html>`_
`Open visualization! <../../_static/ofg2.html>`__
Feedback
--------
......
......@@ -14,7 +14,7 @@ class OpFromGraph(gof.Op):
This creates an `Op` from inputs and outputs lists of variables.
The signature is similar to theano.function() and the resulting
`Op`'s perform will do the same operation as:
`Op`'s perform will do the same operation as::
orig_function(inputs, outputs, **kwargs)
......
......@@ -242,7 +242,7 @@ class Function(object):
A Function instance may be serialized using the `pickle` or
`cPickle` modules. This will save all default inputs, the graph,
and *** to the pickle file (WRITEME).
and WRITEME to the pickle file.
A Function instance have a ``trust_input`` field that default to
False. When True, we don't do extra check of the input to give
......
......@@ -18,9 +18,9 @@ def replace_patterns(x, replace):
Parameters
----------
s: str
s : str
String on which function is applied
replace: dict
replace : dict
`key`, `value` pairs where key is a regular expression and `value` a
string by which `key` is replaced
"""
......@@ -34,7 +34,7 @@ def escape_quotes(s):
Parameters
----------
s: str
s : str
String on which function is applied
"""
s = re.sub(r'''(['"])''', r'\\\1', s)
......@@ -66,10 +66,12 @@ def d3viz(fct, outfile, copy_deps=True, *args, **kwargs):
Path to output HTML file.
copy_deps : bool, optional
Copy javascript and CSS dependencies to output directory.
*args : tuple, optional
Arguments passed to PyDotFormatter.
*kwargs : dict, optional
Arguments passed to PyDotFormatter.
Notes
-----
This function accepts extra parameters which will be forwarded to
:class:`theano.d3viz.formatting.PyDotFormatter`.
"""
# Create DOT graph
......@@ -121,10 +123,12 @@ def d3write(fct, path, *args, **kwargs):
A compiled Theano function, variable, apply or a list of variables.
path: str
Path to output file
*args : tuple, optional
Arguments passed to PyDotFormatter.
*kwargs : dict, optional
Arguments passed to PyDotFormatter.
Notes
-----
This function accepts extra parameters which will be forwarded to
:class:`theano.d3viz.formatting.PyDotFormatter`.
"""
formatter = PyDotFormatter(*args, **kwargs)
......
......@@ -192,13 +192,13 @@ def deprecated(filename, msg=''):
"""
Decorator which will print a warning message on the first call.
Use it like this:
Use it like this::
@deprecated('myfile', 'do something different...')
def fn_name(...)
...
And it will print:
And it will print::
WARNING myfile.fn_name deprecated. do something different...
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论