Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
46a7640c
提交
46a7640c
authored
6月 29, 2012
作者:
nouiz
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #724 from nouiz/small
Small
上级
e6f30b8f
bac3c2f7
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
31 行增加
和
7 行删除
+31
-7
gradient.py
theano/gradient.py
+11
-5
check_blas.py
theano/misc/check_blas.py
+13
-2
__init__.py
theano/sandbox/cuda/__init__.py
+7
-0
没有找到文件。
theano/gradient.py
浏览文件 @
46a7640c
...
...
@@ -721,9 +721,10 @@ class numeric_grad(object):
return
(
max_arg
,
pos
[
max_arg
],
abs_errs
[
max_arg
],
rel_errs
[
max_arg
])
def
verify_grad
(
fun
,
pt
,
n_tests
=
2
,
rng
=
None
,
eps
=
None
,
out_type
=
None
,
abs_tol
=
None
,
def
verify_grad
(
fun
,
pt
,
n_tests
=
2
,
rng
=
None
,
eps
=
None
,
out_type
=
None
,
abs_tol
=
None
,
rel_tol
=
None
,
mode
=
None
,
cast_to_output_type
=
False
):
"""
Test a gradient by Finite Difference Method. Raise error on failure.
"""Test a gradient by Finite Difference Method. Raise error on failure.
Example:
>>> verify_grad(theano.tensor.tanh,
...
...
@@ -745,6 +746,10 @@ def verify_grad(fun, pt, n_tests=2, rng=None, eps=None, out_type=None, abs_tol=N
of sum(u * fun) at pt
:param eps: stepsize used in the Finite Difference Method (Default
None is type-dependent)
Raising the value of eps can raise or lower the absolute and
relative error of the verification depending of the
Op. Raising the eps do not lower the verification quality. It
is better to raise eps then raising abs_tol or rel_tol.
:param out_type: dtype of output, if complex (i.e. 'complex32' or
'complex64')
:param abs_tol: absolute tolerance used as threshold for gradient
...
...
@@ -757,9 +762,10 @@ def verify_grad(fun, pt, n_tests=2, rng=None, eps=None, out_type=None, abs_tol=N
in debug mode, which can be very slow if it has to verify a lot of
intermediate computations.
:note: This op does not support multiple outputs. In tests/test_scan.py
there is an experimental verify_grad that covers that case as well
by using random projections.
:note: This function does not support multiple outputs. In
tests/test_scan.py there is an experimental verify_grad that
covers that case as well by using random projections.
"""
from
theano
import
compile
,
shared
import
theano.tensor
...
...
theano/misc/check_blas.py
浏览文件 @
46a7640c
...
...
@@ -187,8 +187,18 @@ if __name__ == "__main__":
(cuda version 3.2RC and up have a faster gemm on the Fermi/GTX[45]??)
gpu/cuda version
GTX580/3.2 0.20s
GTX480/3.2 0.24s
GTX680/4.2 0.154s
GTX580/4.2 0.164s
GTX480/4.2 0.192s
GTX470/4.2 0.238s
GTX285/4.2 0.452s #cuda 3.0 seam faster? driver version?
GTX580/3.2 0.203s
GTX680/3.2 0.218s
GTX480/3.2 0.237s
GTX470/3.2 0.297s
GTX285/3.2 0.452s #cuda 3.0 seam faster? driver version?
GTX480/3.0 0.27s
M2070/4.1 0.27s
GTX470/3.2 0.29s
...
...
@@ -197,6 +207,7 @@ if __name__ == "__main__":
GTX285/3.0 0.40s
C1060/3.2 0.46s
GTX550Ti/4.0 0.57s
520/3.2 3.06s
520M/3.2 3.19s with bumblebee on Ubuntu 12.04
GT220/3.2RC 3.80s
GT210/4.0 6.35s
...
...
theano/sandbox/cuda/__init__.py
浏览文件 @
46a7640c
...
...
@@ -163,6 +163,13 @@ if compile_cuda_ndarray:
set_cuda_disabled
()
finally
:
release_lock
()
elif
not
nvcc_compiler
.
is_nvcc_available
():
# This can happen if there is cuda_ndarray.so was already compiled
# and then nvcc is removed. In that case we need to disable the CUDA
# back-end as we won't be able to compile any new op and we can't only
# use already compiled GPU op and not the others.
set_cuda_disabled
()
del
compile_cuda_ndarray
if
cuda_available
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论