Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
de0a5dcb
提交
de0a5dcb
authored
11月 23, 2010
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed a few typos / grammar errors in doc
上级
8fe55d6f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
11 行增加
和
11 行删除
+11
-11
function.txt
doc/library/compile/function.txt
+1
-1
shared_randomstreams.txt
doc/library/tensor/shared_randomstreams.txt
+7
-7
examples.txt
doc/tutorial/examples.txt
+3
-3
没有找到文件。
doc/library/compile/function.txt
浏览文件 @
de0a5dcb
...
@@ -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 mention
n
ed 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
...
...
doc/library/tensor/shared_randomstreams.txt
浏览文件 @
de0a5dcb
...
@@ -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
t
heano's computations is to
The way to think about putting randomness into
T
heano'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 wi
ll 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 f
rom
the
:returns: a list of all the (state, new_state) update pairs f
or
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
...
...
doc/tutorial/examples.txt
浏览文件 @
de0a5dcb
...
@@ -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' represen
en
ts 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
thing
s. If we call f(), we get random uniform numbers.
Now let's use these
object
s. 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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论