Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6ef12887
提交
6ef12887
authored
3月 30, 2009
作者:
desjagui@atchoum.iro.umontreal.ca
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed test_mat_reciprocal unittest (seed issue) + merge
上级
45881a7d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
4 行增加
和
12 行删除
+4
-12
module.txt
doc/basic_tutorial/module.txt
+0
-4
install.txt
doc/install.txt
+0
-7
test_basic.py
theano/tensor/tests/test_basic.py
+4
-1
没有找到文件。
doc/basic_tutorial/module.txt
浏览文件 @
6ef12887
...
@@ -184,7 +184,6 @@ boilerplate code.
...
@@ -184,7 +184,6 @@ boilerplate code.
All we need to do to use this mechanism is to give a method called
All we need to do to use this mechanism is to give a method called
``_instance_print_state`` to our Module class.
``_instance_print_state`` to our Module class.
.. literalinclude:: ../examples/module/mechanism1.py
Any method called like ``_instance_XXX`` will cause the object
Any method called like ``_instance_XXX`` will cause the object
obtained through a call to ``make`` to have a method called ``XXX``.
obtained through a call to ``make`` to have a method called ``XXX``.
...
@@ -204,7 +203,6 @@ If a number of instance methods are going to be defined, and especially if you
...
@@ -204,7 +203,6 @@ 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.
you might prefer to consider using the InstanceType mechanism.
.. literalinclude:: ../examples/module/mechanism2.py
Adding custom initialization
Adding custom initialization
============================
============================
...
@@ -221,7 +219,6 @@ can override the default with your own method, which has to be called
...
@@ -221,7 +219,6 @@ can override the default with your own method, which has to be called
Here is an example where we take width and height arguments to
Here is an example where we take width and height arguments to
initialize a state with a matrix of zeros:
initialize a state with a matrix of zeros:
.. literalinclude:: ../examples/module/accumulator.py
Nesting Modules
Nesting Modules
...
@@ -231,7 +228,6 @@ Probably the most powerful feature of theano's modules is that one can be
...
@@ -231,7 +228,6 @@ 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
included as an attribute to another so that the storage of each is available
to both.
to both.
.. literalinclude:: ../examples/module/nested.py
As you read through examples of Theano code, you will probably see many
As you read through examples of Theano code, you will probably see many
instances of Modules being nested in this way.
instances of Modules being nested in this way.
doc/install.txt
浏览文件 @
6ef12887
...
@@ -108,13 +108,6 @@ automatic code generation, but that way is much, much slower.
...
@@ -108,13 +108,6 @@ automatic code generation, but that way is much, much slower.
Omitting this variable defaults the mode to 'FAST_RUN'.
Omitting this variable defaults the mode to 'FAST_RUN'.
- `THEANO_UNITTEST_SEED`:
An integer value specifying which seed should be used when
running unit tests. If this variable is not defined, the seed will default
to 666. Users wishing for non-deterministic behaviour can set this
variable to 'random'.
Mac
Mac
---
---
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
6ef12887
...
@@ -1305,6 +1305,9 @@ class test_matinv(unittest.TestCase):
...
@@ -1305,6 +1305,9 @@ class test_matinv(unittest.TestCase):
# and none of the dimensions are constrained to have length 1.
# and none of the dimensions are constrained to have length 1.
# Note that TensorType's constructor does not actually allocate any memory.
# Note that TensorType's constructor does not actually allocate any memory.
# TODO: Make TensorType syntax more explicit, and maybe give shape or number of dimensions.
# TODO: Make TensorType syntax more explicit, and maybe give shape or number of dimensions.
unittest_tools
.
seed_rng
()
a
,
b
=
matrices
(
'ab'
)
a
,
b
=
matrices
(
'ab'
)
ab
=
a
*
b
ab
=
a
*
b
# Here, as_tensor_variable actually uses the data allocated by numpy.
# Here, as_tensor_variable actually uses the data allocated by numpy.
...
@@ -1334,7 +1337,7 @@ class test_matinv(unittest.TestCase):
...
@@ -1334,7 +1337,7 @@ class test_matinv(unittest.TestCase):
"""Matrix reciprocal by gradient descent"""
"""Matrix reciprocal by gradient descent"""
ssd0
,
ssd
=
self
.
mat_reciprocal
(
3
)
ssd0
,
ssd
=
self
.
mat_reciprocal
(
3
)
numpy
.
random
.
seed
(
unittest_tools
.
fetch_seed
(
1
)
)
unittest_tools
.
seed_rng
(
)
# hand-coded numpy implementation for verification
# hand-coded numpy implementation for verification
x
=
numpy
.
random
.
rand
(
3
,
3
)
+
0.1
x
=
numpy
.
random
.
rand
(
3
,
3
)
+
0.1
w
=
numpy
.
random
.
rand
(
3
,
3
)
w
=
numpy
.
random
.
rand
(
3
,
3
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论