提交 de0a5dcb authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Fixed a few typos / grammar errors in doc

上级 8fe55d6f
...@@ -149,7 +149,7 @@ Reference ...@@ -149,7 +149,7 @@ Reference
will be used as the update expression for this variable. Passing will be used as the update expression for this variable. Passing
``no_default_updates=True`` to ``function`` disables this behavior ``no_default_updates=True`` to ``function`` disables this behavior
entirely, passing ``no_default_updates=[sharedvar1, sharedvar2]`` entirely, passing ``no_default_updates=[sharedvar1, sharedvar2]``
disables it for the mentionned variables. disables it for the mentioned variables.
Regarding givens: Be careful to make sure that these substitutions are Regarding givens: Be careful to make sure that these substitutions are
independent--behaviour when Var1 of one pair appears in the graph leading independent--behaviour when Var1 of one pair appears in the graph leading
......
...@@ -16,11 +16,11 @@ Since Theano uses a functional design, producing pseudo-random numbers in a ...@@ -16,11 +16,11 @@ Since Theano uses a functional design, producing pseudo-random numbers in a
graph is not quite as straightforward as it is in numpy. If you are using Theano's graph is not quite as straightforward as it is in numpy. If you are using Theano's
shared variables, then a `RandomStreams` object is probably what you want. (If you are shared variables, then a `RandomStreams` object is probably what you want. (If you are
using Module then this tutorial will be useful but not exactly what you want. using Module then this tutorial will be useful but not exactly what you want.
Have a look at the :api:`RandomFunction` Op.) Have a look at the :class:`RandomFunction` Op.)
The way to think about putting randomness into theano's computations is to The way to think about putting randomness into Theano's computations is to
put random variables in your graph. Theano will allocate a numpy RandomState put random variables in your graph. Theano will allocate a numpy RandomState
object for each such variable, and draw from it as necessary. I'll call this sort of sequence of object for each such variable, and draw from it as necessary. We will call this sort of sequence of
random numbers a *random stream*. random numbers a *random stream*.
For an example of how to use random numbers, see For an example of how to use random numbers, see
...@@ -38,8 +38,8 @@ Reference ...@@ -38,8 +38,8 @@ Reference
.. method:: updates() .. method:: updates()
:returns: a list of all the (state, new_state) update pairs from the :returns: a list of all the (state, new_state) update pairs for the
random variables it has returned. random variables created by this object
This can be a convenient shortcut to enumerating all the random This can be a convenient shortcut to enumerating all the random
variables in a large graph in the ``update`` parameter of function. variables in a large graph in the ``update`` parameter of function.
...@@ -47,8 +47,8 @@ Reference ...@@ -47,8 +47,8 @@ Reference
.. method:: seed(meta_seed) .. method:: seed(meta_seed)
`meta_seed` will be used to seed a temporary random number generator, `meta_seed` will be used to seed a temporary random number generator,
that will in turn generate seeds for each of the random variables that that will in turn generate seeds for all random variables
has been created by this object (via `gen`). created by this object (via `gen`).
:returns: None :returns: None
......
...@@ -377,11 +377,11 @@ Here's a brief example. The setup code is: ...@@ -377,11 +377,11 @@ Here's a brief example. The setup code is:
nearly_zeros = function([], rv_u + rv_u - 2 * rv_u) nearly_zeros = function([], rv_u + rv_u - 2 * rv_u)
Here, 'rv_u' represents a random stream of 2x2 matrices of draws from a uniform Here, 'rv_u' represents a random stream of 2x2 matrices of draws from a uniform
distribution. Likewise, 'rv_n' represenents a random stream of 2x2 matrices of distribution. Likewise, 'rv_n' represents a random stream of 2x2 matrices of
draws from a normal distribution. The distributions that are implemented are draws from a normal distribution. The distributions that are implemented are
defined in :class:`RandomStreams`. defined in :class:`RandomStreams`.
Now let's use these things. If we call f(), we get random uniform numbers. Now let's use these objects. If we call f(), we get random uniform numbers.
The internal state of the random number generator is automatically updated, The internal state of the random number generator is automatically updated,
so we get different random numbers every time. so we get different random numbers every time.
...@@ -394,7 +394,7 @@ not affected by calling the returned function. So for example, calling ...@@ -394,7 +394,7 @@ not affected by calling the returned function. So for example, calling
``g`` multiple times will return the same numbers. ``g`` multiple times will return the same numbers.
>>> g_val0 = g() # different numbers from f_val0 and f_val1 >>> g_val0 = g() # different numbers from f_val0 and f_val1
>>> g_val1 = g() # same numbers as g_val0 !!! >>> g_val1 = g() # same numbers as g_val0!
An important remark is that a random variable is drawn at most once during any An important remark is that a random variable is drawn at most once during any
single function execution. So the ``nearly_zeros`` function is guaranteed to single function execution. So the ``nearly_zeros`` function is guaranteed to
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论