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

Fix d3viz doc errors.

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