提交 7344f170 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

merge

......@@ -129,7 +129,7 @@ Note how the call to ``Apply`` modifies the ``owner`` and ``index``
fields of the :ref:`Variables <variable>` passed as outputs to point to
itself and the rank they occupy in the output list. This whole
machinery builds a DAG (Directed Acyclic Graph) representing the
computation, a graph that theano can compile and optimize.
computation, a graph that Theano can compile and optimize.
Automatic wrapping
......@@ -189,8 +189,8 @@ inputs. Therefore, an Apply node may be obtained from an Op
and a list of inputs by calling ``Op.make_node(*inputs)``.
Comparing with the Python language, an :ref:`apply` node is
theano's version of a function call whereas an :ref:`op` is
theano's version of a function definition.
Theano's version of a function call whereas an :ref:`op` is
Theano's version of a function definition.
An Apply instance has three important fields:
......
......@@ -94,7 +94,7 @@ operation on ``x``.
.. note::
Inplace operations in theano still work in a functional setting:
Inplace operations in Theano still work in a functional setting:
they need to return the modified input. Symbolically, Theano
requires one Variable standing for the input *before* being modified
and *another* Variable representing the input *after* being
......
......@@ -160,7 +160,7 @@ the Type is to instantiate a plain Type and set the needed fields:
.. code-block:: python
from theano import gof
from Theano import gof
double = gof.Type()
double.filter = filter
......@@ -216,7 +216,7 @@ There are several ways to make sure that equality testing works properly:
#. Hide the Double class and only advertise a single instance of it.
Here we will prefer the final option, because it's the simplest.
Often Ops in the theano code define the ``__eq__`` function though.
Often Ops in the Theano code define the ``__eq__`` function though.
Untangling some concepts
......
......@@ -179,7 +179,7 @@ Extending your Module with Python methods
Let's say we want to add a method to our accumulator to print out the
state and we want to call it ``print_state``. There are two mechanisms to do
this: let's call them instance methods and InstanceType.
this: let's call them _instance_method and InstanceType.
Mechanism 1: _instance_method
......@@ -198,7 +198,7 @@ Note that when we define ``_instance_print_state`` there are two "self"
arguments: ``self`` which is *symbolic* and ``obj`` which is the compiled
object (the one that contains values).
Hint:``self.state`` is the symbolic state variable and
Hint: ``self.state`` is the symbolic state variable and
prints out as "state", whereas ``obj.state`` is the state's actual
value in the accumulator and prints out as "0.0".
......@@ -207,7 +207,7 @@ Mechanism 2: InstanceType
-------------------------
If a number of instance methods are going to be defined, and especially if you
will want to inherit from the kind of class that gets instantiated by make,
will want to inherit from the kind of class that gets instantiated by ``make``,
you might prefer to consider using the InstanceType mechanism.
......@@ -223,15 +223,16 @@ where we give the states' initial values with keyword arguments
can override the default with your own method, which has to be called
``_instance_initialize``.
Here is an example where we take width and height arguments to
initialize a state with a matrix of zeros:
.. TODO
Here is an example where we take width and height arguments to
initialize a state with a matrix of zeros:
Nesting Modules
===============
Probably the most powerful feature of theano's modules is that one can be
Probably the most powerful feature of Theano's Modules is that one can be
included as an attribute to another so that the storage of each is available
to both.
......
......@@ -8,14 +8,14 @@ Basic Tutorial Mini-Reference
Mode
====
============= =========================================================== ===============================================================================
================= =============================================================== ===============================================================================
short name Full constructor What does it do?
============= =========================================================== ===============================================================================
(default) compile.mode.Mode(linker='py', optimizer=None) Python implementations with zero graph modifications.
FAST_COMPILE compile.mode.Mode(linker='c|py', optimizer='fast_compile') C implementations where available, quick and cheap graph transformations
FAST_RUN compile.mode.Mode(linker='c|py', optimizer='fast_run') C implementations where available, all available graph transformations.
DEBUG_MODE compile.debugmode.DebugMode() Both implementations where available, all available graph transformations.
============= =========================================================== ===============================================================================
================= =============================================================== ===============================================================================
(default) ``compile.mode.Mode(linker='py', optimizer=None)`` Python implementations with zero graph modifications.
FAST_COMPILE ``compile.mode.Mode(linker='c|py', optimizer='fast_compile')`` C implementations where available, quick and cheap graph transformations
FAST_RUN ``compile.mode.Mode(linker='c|py', optimizer='fast_run')`` C implementations where available, all available graph transformations.
DEBUG_MODE ``compile.debugmode.DebugMode()`` Both implementations where available, all available graph transformations.
================= =============================================================== ===============================================================================
.. _tensortypes:
......
......@@ -9,7 +9,7 @@ class AccumulatorInstance(ModuleInstance):
class Accumulator(Module):
# This line tells theano to instantiate an AccumulatorInstance
# This line tells Theano to instantiate an AccumulatorInstance
# when make() is called.
InstanceType = AccumulatorInstance
......
......@@ -91,10 +91,10 @@ Glossary of terminology
WRITEME
type
See :ref:`tensortypes`
See :ref:`tensortypes` or :ref:`type`.
Variable
A :ref:`variable` is the main data structure you work with when
A :ref:`Variable` is the main data structure you work with when
using Theano. The symbolic inputs that you operate on are
Variables and what you get from applying various operations to
these inputs are also Variables. For example, when I type
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论