Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a7aeeba3
提交
a7aeeba3
authored
8月 30, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove duplicate doc by linking to the second place.
Make the Rop_Checker init the rng by default.
上级
9d0c3dd2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
9 行增加
和
14 行删除
+9
-14
unittest.txt
doc/extending/unittest.txt
+2
-0
extending_theano.txt
doc/tutorial/extending_theano.txt
+6
-14
test_rop.py
theano/tests/test_rop.py
+1
-0
没有找到文件。
doc/extending/unittest.txt
浏览文件 @
a7aeeba3
...
...
@@ -308,6 +308,8 @@ type this:
THEANO_FLAGS='mode=FAST_RUN' nosetests
THEANO_FLAGS='mode=DEBUG_MODE' nosetests
.. _random_value_in_tests:
Using Random Values in Test Cases
---------------------------------
...
...
doc/tutorial/extending_theano.txt
浏览文件 @
a7aeeba3
...
...
@@ -350,24 +350,16 @@ Here is some code that allow to make the op Optional:
Random number in tests
----------------------
Making test errors more reproducable is a good practice. To make your
Making test
s
errors more reproducable is a good practice. To make your
tests more reproducable, you need a way to get the same random
number. You can do this by seeding NumPy's randon number
generator. There is the Theano flag unittest.rseed that specify the
seed that should be used to init random number generators. There is 2
ways to do this it numpy, here is one:
generator.
.. code-block:: python
# You can set NumPy's internal random number generator state with
numpy.random.seed(utt.fetch_seed())
# All following call to numpy.random.*() function will get affected.
# Or you can create a new RandomState separate from the others
rng = numpy.random.RandomState(utt.fetch_seed())
# You can call all numpy's random number generator function's on rng
rng.rand(5, 5)
For conveniance, the classes InferShapeTester and RopLop_checker
already do this for you. If you implement your own ``setUp`` function,
don't forget to call the parent ``setUp`` function.
For more details see :ref:`random_value_in_tests`.
GPU Op
------
...
...
theano/tests/test_rop.py
浏览文件 @
a7aeeba3
...
...
@@ -58,6 +58,7 @@ class RopLop_checker(unittest.TestCase):
Rop to class that inherit from it."""
def
setUp
(
self
):
utt
.
seed_rng
()
# Using vectors make things a lot simpler for generating the same
# computations using scan
self
.
x
=
tensor
.
vector
(
'x'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论