提交 49fe6270 authored 作者: Frederic's avatar Frederic

Doc fixes following code review.

上级 910bd90d
...@@ -11,12 +11,12 @@ Profiling Theano function ...@@ -11,12 +11,12 @@ Profiling Theano function
anymore. anymore.
Besides checking for errors, another important task is to profile your Besides checking for errors, another important task is to profile your
code. For this Theano uses Theano flags and/or parameters which are code. For this, you can use Theano flags and/or parameters which are
to be passed as an argument to :func:`theano.function <function.function>`. to be passed as an argument to :func:`theano.function <function.function>`.
The simplest way to profile Theano function is to use the Theano flags The simplest way to profile Theano functions is to use the Theano
described bellow. When the process exit, they will cause the printing flags described below. When the process exits, they will cause the
of the information requested to the stdout. information to be printed on stdout.
Using the ProfileMode is a three-step process. Using the ProfileMode is a three-step process.
...@@ -39,35 +39,35 @@ You can use the Theano flags :attr:`profiling.n_apply`, ...@@ -39,35 +39,35 @@ You can use the Theano flags :attr:`profiling.n_apply`,
modify the quantify of information printed. modify the quantify of information printed.
The profiler will output one profile per Theano function and profile The profiler will output one profile per Theano function and profile
that is the sum of the printed profile. Each profile contain 4 that is the sum of the printed profile. Each profile contains 4
sections: global info, class info, Ops info and Apply node info. sections: global info, class info, Ops info and Apply node info.
In the global section, the "Message" is the name of the Theano In the global section, the "Message" is the name of the Theano
function. theano.function() have an optional parameter name that function. theano.function() has an optional parameter ``name`` that
default to None. Change it to something else to help you profile many defaults to None. Change it to something else to help you profile many
Theano function. In that section, we also see the number of time the Theano functions. In that section, we also see the number of time the
function was called (1) and the total time spent in all those function was called (1) and the total time spent in all those
calls. The time spent in Function.fn.__call__ and in thunks are useful calls. The time spent in Function.fn.__call__ and in thunks is useful
to help understand Theano overhead. to help understand Theano overhead.
Also, we see the time spend in the compilation and we see the time Also, we see the time spent in the two parts of the compilation
spent in the 2 parts of the compilation process: optimization(modify process: optimization(modify the graph to make it more stable/faster)
the graph to make it more stable/faster) and the linking (compile c and the linking (compile c code and make the Python callable returned
code and make the Python callable returned by function). by function).
The class, Ops and Apply node are the same information: information The class, Ops and Apply nodes sections are the same information:
about the apply node that ran. The Ops section take the information information about the apply node that ran. The Ops section takes the
from the Apply section and merge the Apply node that have exactly the information from the Apply section and merge the Apply nodes that have
same op. For example, if two Apply node in the graph have two Ops that exactly the same op. If two Apply nodes in the graph have two Ops that
compare equal, they will be merged. Some ops like Elemwise, will not compare equal, they will be merged. Some ops like Elemwise, will not
compare equal, if there parameter differ. The section class will more compare equal, if their parameters differ (the scalar being
all Apply node whose Ops are from the same class. So they will merge executed). So the class section will merge more Apply nodes then the
addition and multiplication elemwise node. Ops section.
Here is an example output when we disable some Theano optimization to Here is an example output when we disable some Theano optimizations to
show you better the difference between section. With Theano give you a better idea of the difference between sections. With all
optimization, that graph will result in only one operation in the optimizations enabled, there would be only one op left in the graph.
graph.
to run the example: to run the example:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论