Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
bd3749d2
提交
bd3749d2
authored
11月 03, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tests due to change to gradient check dtype.
上级
26d6e34a
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
16 行增加
和
15 行删除
+16
-15
test_basic.py
theano/sparse/tests/test_basic.py
+2
-2
test_conv3d2d.py
theano/tensor/nnet/tests/test_conv3d2d.py
+1
-1
test_basic.py
theano/tensor/tests/test_basic.py
+12
-11
test_elemwise.py
theano/tensor/tests/test_elemwise.py
+1
-1
没有找到文件。
theano/sparse/tests/test_basic.py
浏览文件 @
bd3749d2
...
@@ -2322,7 +2322,7 @@ class CastTester(utt.InferShapeTester):
...
@@ -2322,7 +2322,7 @@ class CastTester(utt.InferShapeTester):
eps
=
None
eps
=
None
if
o_dtype
==
'float32'
:
if
o_dtype
==
'float32'
:
eps
=
7e-4
eps
=
1e-2
verify_grad_sparse
(
Cast
(
o_dtype
),
data
,
eps
=
eps
)
verify_grad_sparse
(
Cast
(
o_dtype
),
data
,
eps
=
eps
)
...
@@ -2386,7 +2386,7 @@ class _HVStackTester(utt.InferShapeTester):
...
@@ -2386,7 +2386,7 @@ class _HVStackTester(utt.InferShapeTester):
self
.
op_class
(
format
=
out_f
,
dtype
=
dtype
),
self
.
op_class
(
format
=
out_f
,
dtype
=
dtype
),
self
.
mat
[
format
],
self
.
mat
[
format
],
structured
=
False
,
structured
=
False
,
eps
=
7e-4
)
eps
=
1e-1
)
def
_hv_switch
(
op
,
expected_function
):
def
_hv_switch
(
op
,
expected_function
):
...
...
theano/tensor/nnet/tests/test_conv3d2d.py
浏览文件 @
bd3749d2
...
@@ -117,4 +117,4 @@ def test_conv3d(mode=mode_without_gpu, shared=theano.tensor._shared):
...
@@ -117,4 +117,4 @@ def test_conv3d(mode=mode_without_gpu, shared=theano.tensor._shared):
signals
=
numpy
.
random
.
rand
(
Ns
,
Ts
,
C
,
Hs
,
Ws
)
.
astype
(
'float32'
)
signals
=
numpy
.
random
.
rand
(
Ns
,
Ts
,
C
,
Hs
,
Ws
)
.
astype
(
'float32'
)
filters
=
numpy
.
random
.
rand
(
Nf
,
Tf
,
C
,
Hf
,
Wf
)
.
astype
(
'float32'
)
filters
=
numpy
.
random
.
rand
(
Nf
,
Tf
,
C
,
Hf
,
Wf
)
.
astype
(
'float32'
)
utt
.
verify_grad
(
conv3d
,
[
signals
,
filters
])
utt
.
verify_grad
(
conv3d
,
[
signals
,
filters
]
,
eps
=
1e-1
)
theano/tensor/tests/test_basic.py
浏览文件 @
bd3749d2
...
@@ -3277,18 +3277,18 @@ class T_Join_and_Split(unittest.TestCase):
...
@@ -3277,18 +3277,18 @@ class T_Join_and_Split(unittest.TestCase):
self
.
assertTrue
((
out
==
want
)
.
all
())
self
.
assertTrue
((
out
==
want
)
.
all
())
def
test_join_matrix1
(
self
):
def
test_join_matrix1
(
self
):
av
=
numpy
.
array
([[
1
,
2
,
3
],
[
4
,
5
,
6
]],
dtype
=
'float32'
)
av
=
numpy
.
array
([[
.
1
,
.
2
,
.
3
],
[
.
4
,
.
5
,
.
6
]],
dtype
=
'float32'
)
bv
=
numpy
.
array
([[
7
],
[
8
]],
dtype
=
'float32'
)
bv
=
numpy
.
array
([[
.
7
],
[
.
8
]],
dtype
=
'float32'
)
a
=
self
.
shared
(
av
)
a
=
self
.
shared
(
av
)
b
=
as_tensor_variable
(
bv
)
b
=
as_tensor_variable
(
bv
)
s
=
join
(
1
,
a
,
b
)
s
=
join
(
1
,
a
,
b
)
want
=
numpy
.
array
([[
1
,
2
,
3
,
7
],
[
4
,
5
,
6
,
8
]],
dtype
=
'float32'
)
want
=
numpy
.
array
([[
.
1
,
.
2
,
.
3
,
.
7
],
[
.
4
,
.
5
,
.
6
,
.
8
]],
dtype
=
'float32'
)
out
=
self
.
eval_outputs_and_check_join
([
s
])
out
=
self
.
eval_outputs_and_check_join
([
s
])
self
.
assertTrue
((
out
==
want
)
.
all
())
self
.
assertTrue
((
out
==
want
)
.
all
())
# assert tensor.grad(join(1,a,b), a
utt
.
verify_grad
(
lambda
a
,
b
:
join
(
1
,
a
,
b
),
[
av
,
bv
],
utt
.
verify_grad
(
lambda
a
,
b
:
join
(
1
,
a
,
b
),
[
av
,
bv
],
eps
=
1.0e-4
,
rel_tol
=
1.0e-3
,
mode
=
self
.
mode
)
mode
=
self
.
mode
)
def
test_join_matrix_dtypes
(
self
):
def
test_join_matrix_dtypes
(
self
):
if
"float32"
in
self
.
shared
.
__name__
:
if
"float32"
in
self
.
shared
.
__name__
:
...
@@ -3308,7 +3308,7 @@ class T_Join_and_Split(unittest.TestCase):
...
@@ -3308,7 +3308,7 @@ class T_Join_and_Split(unittest.TestCase):
grad
(
s
.
sum
(),
b
)
grad
(
s
.
sum
(),
b
)
grad
(
s
.
sum
(),
a
)
grad
(
s
.
sum
(),
a
)
utt
.
verify_grad
(
lambda
b
:
join
(
1
,
a
,
b
),
[
bv
],
utt
.
verify_grad
(
lambda
b
:
join
(
1
,
a
,
b
),
[
bv
],
eps
=
1.0e-
4
,
rel_tol
=
1.0e-3
,
mode
=
self
.
mode
)
eps
=
1.0e-
2
,
mode
=
self
.
mode
)
def
test_join_matrix_ints
(
self
):
def
test_join_matrix_ints
(
self
):
if
"float32"
in
self
.
shared
.
__name__
:
if
"float32"
in
self
.
shared
.
__name__
:
...
@@ -3339,20 +3339,21 @@ class T_Join_and_Split(unittest.TestCase):
...
@@ -3339,20 +3339,21 @@ class T_Join_and_Split(unittest.TestCase):
self
.
assertTrue
((
out
==
want
)
.
all
())
self
.
assertTrue
((
out
==
want
)
.
all
())
def
test_join_matrix1_using_horizontal_stack
(
self
):
def
test_join_matrix1_using_horizontal_stack
(
self
):
av
=
numpy
.
array
([[
1
,
2
,
3
],
[
4
,
5
,
6
]],
dtype
=
'float32'
)
av
=
numpy
.
array
([[
.
1
,
.
2
,
.
3
],
[
.
4
,
.
5
,
.
6
]],
dtype
=
'float32'
)
bv
=
numpy
.
array
([[
7
],
[
8
]],
dtype
=
'float32'
)
bv
=
numpy
.
array
([[
.
7
],
[
.
8
]],
dtype
=
'float32'
)
cv
=
numpy
.
array
([[
3
,
2
,
1
],
[
6
,
5
,
4
]],
dtype
=
'float32'
)
cv
=
numpy
.
array
([[
.
3
,
.
2
,
.
1
],
[
.
6
,
.
5
,
.
4
]],
dtype
=
'float32'
)
a
=
self
.
shared
(
av
)
a
=
self
.
shared
(
av
)
b
=
as_tensor_variable
(
bv
)
b
=
as_tensor_variable
(
bv
)
c
=
as_tensor_variable
(
cv
)
c
=
as_tensor_variable
(
cv
)
s
=
horizontal_stack
(
a
,
b
,
c
)
s
=
horizontal_stack
(
a
,
b
,
c
)
want
=
numpy
.
array
([[
1
,
2
,
3
,
7
,
3
,
2
,
1
],
[
4
,
5
,
6
,
8
,
6
,
5
,
4
]],
want
=
numpy
.
array
([[
.
1
,
.
2
,
.
3
,
.
7
,
.
3
,
.
2
,
.
1
],
[
.
4
,
.
5
,
.
6
,
.
8
,
.
6
,
.
5
,
.
4
]],
dtype
=
'float32'
)
dtype
=
'float32'
)
out
=
self
.
eval_outputs_and_check_join
([
s
])
out
=
self
.
eval_outputs_and_check_join
([
s
])
self
.
assertTrue
((
out
==
want
)
.
all
())
self
.
assertTrue
((
out
==
want
)
.
all
())
utt
.
verify_grad
(
lambda
a
,
b
:
join
(
1
,
a
,
b
),
[
av
,
bv
],
utt
.
verify_grad
(
lambda
a
,
b
:
join
(
1
,
a
,
b
),
[
av
,
bv
],
eps
=
1.0e-4
,
rel_tol
=
1.0e-3
,
mode
=
self
.
mode
)
mode
=
self
.
mode
)
def
test_join_matrixV
(
self
):
def
test_join_matrixV
(
self
):
"""variable join axis"""
"""variable join axis"""
...
...
theano/tensor/tests/test_elemwise.py
浏览文件 @
bd3749d2
...
@@ -571,7 +571,7 @@ class test_Prod(unittest.TestCase):
...
@@ -571,7 +571,7 @@ class test_Prod(unittest.TestCase):
# including zeros, as the case with zeros is important
# including zeros, as the case with zeros is important
# (and special cases: 1 zero in the row, more than 1 zero in the row)
# (and special cases: 1 zero in the row, more than 1 zero in the row)
x_val
=
numpy
.
asarray
([[
1
,
2
,
3
],
[
4
,
5
,
6
],
[
7
,
8
,
9
]],
x_val
=
numpy
.
asarray
([[
.
1
,
.
2
,
.
3
],
[
.
4
,
.
5
,
.
6
],
[
.
7
,
.
8
,
.
9
]],
dtype
=
'float32'
)
dtype
=
'float32'
)
# now with verify_grad
# now with verify_grad
unittest_tools
.
verify_grad
(
Prod
(
axis
=
1
),
[
x_val
],
mode
=
self
.
mode
)
unittest_tools
.
verify_grad
(
Prod
(
axis
=
1
),
[
x_val
],
mode
=
self
.
mode
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论