Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ddd1dc03
提交
ddd1dc03
authored
11月 26, 2011
作者:
nouiz
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #235 from delallea/minor
Minor
上级
10df577e
04fa3286
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
24 行增加
和
17 行删除
+24
-17
function_module.py
theano/compile/function_module.py
+2
-2
elemwise.py
theano/sandbox/cuda/elemwise.py
+7
-5
ops.py
theano/sandbox/linalg/ops.py
+4
-2
neighbours.py
theano/sandbox/neighbours.py
+4
-2
test_scan.py
theano/scan_module/tests/test_scan.py
+5
-4
tensor_grad.py
theano/tensor/tensor_grad.py
+2
-2
没有找到文件。
theano/compile/function_module.py
浏览文件 @
ddd1dc03
...
...
@@ -991,11 +991,11 @@ class FunctionMaker(object):
# optimize the env
compute_test_value_orig
=
theano
.
config
.
compute_test_value
add_stack_trace_on_call
=
gof
.
Op
.
add_stack_trace_on_call
try
:
theano
.
config
.
compute_test_value
=
"off"
start_optimizer
=
time
.
time
()
add_stack_trace_on_call
=
gof
.
Op
.
add_stack_trace_on_call
gof
.
Op
.
add_stack_trace_on_call
=
False
start_optimizer
=
time
.
time
()
optimizer
(
env
)
end_optimizer
=
time
.
time
()
...
...
theano/sandbox/cuda/elemwise.py
浏览文件 @
ddd1dc03
...
...
@@ -5,12 +5,14 @@ The elemwise fct are also used with scalar operation! So it can happen that ndim
"""
import
StringIO
,
sys
import
copy
,
logging
,
StringIO
,
sys
import
numpy
from
theano
import
Op
,
Type
,
Apply
,
Variable
,
Constant
from
theano
import
tensor
,
scalar
,
gof
import
logging
,
copy
from
theano
import
Apply
,
Constant
,
Op
,
Type
,
Variable
from
theano
import
gof
,
scalar
,
tensor
_logger_name
=
'theano.sandbox.cuda.elemwise'
_logger
=
logging
.
getLogger
(
_logger_name
)
_logger
.
setLevel
(
logging
.
INFO
)
...
...
@@ -47,7 +49,7 @@ class NaiveAlgo(object):
if
code
:
raise
SupportCodeError
(
scalar_op
)
except
gof
.
utils
.
MethodNotDefined
:
pass
pass
self
.
scalar_op
=
scalar_op
self
.
sync
=
sync
self
.
inplace_pattern
=
inplace_pattern
...
...
theano/sandbox/linalg/ops.py
浏览文件 @
ddd1dc03
...
...
@@ -696,9 +696,11 @@ def spectral_radius_bound(X, log2_exponent):
if
X
.
type
.
ndim
!=
2
:
raise
TypeError
(
'spectral_radius_bound requires a matrix argument'
,
X
)
if
not
isinstance
(
log2_exponent
,
int
):
raise
TypeError
(
'spectral_radius_bound requires a integer exponent'
,
log2_exponent
)
raise
TypeError
(
'spectral_radius_bound requires an integer exponent'
,
log2_exponent
)
if
log2_exponent
<=
0
:
raise
ValueError
(
'spectral_radius_bound requires a strictly positive exponent'
,
log2_exponent
)
raise
ValueError
(
'spectral_radius_bound requires a strictly positive '
'exponent'
,
log2_exponent
)
XX
=
X
for
i
in
xrange
(
log2_exponent
):
XX
=
tensor
.
dot
(
XX
,
XX
)
...
...
theano/sandbox/neighbours.py
浏览文件 @
ddd1dc03
...
...
@@ -11,8 +11,10 @@ if cuda_available:
class
BadOldCode
(
Exception
):
""" We create a specific Exception to be sure it don't get caught
by mistake"""
"""
We create a specific Exception to be sure it does not get caught by
mistake.
"""
pass
...
...
theano/scan_module/tests/test_scan.py
浏览文件 @
ddd1dc03
...
...
@@ -2600,10 +2600,11 @@ class T_Scan(unittest.TestCase):
assert
numpy
.
allclose
(
theano_y
,
v_y
[
-
4
:])
def
test_opt_order
(
self
):
""" Verify that scan optimizations are applied before blas
optimizations.
This is needed as otherwise, the dot won't become a dot22
so it will be slower and won't get transferred to the gpu.
"""
Verify that scan optimizations are applied before blas
optimizations.
This is needed as otherwise, the dot won't become a dot22
so it will be slower and won't get transferred to the gpu.
"""
x
=
theano
.
tensor
.
matrix
(
'x'
)
A
=
theano
.
tensor
.
matrix
(
'A'
)
...
...
theano/tensor/tensor_grad.py
浏览文件 @
ddd1dc03
...
...
@@ -182,7 +182,7 @@ def Lop(f, wrt, eval_points, consider_constant=None, warn_type=False,
inputs
=
gof
.
graph
.
inputs
(
f
)
gmap
=
gradient
.
grad_sources_inputs
(
zip
(
f
,
eval_points
),
zip
(
f
,
eval_points
),
list
(
inputs
)
+
list
(
consider_constant
),
warn_type
=
warn_type
)
...
...
@@ -337,7 +337,7 @@ def grad(cost, wrt, g_cost=None, consider_constant=None, warn_type=False,
if
len
(
ret
)
==
1
and
not
(
using_list
or
using_tuple
):
# `wrt` was a single Variable, so we return a single Variable too.
return
ret
[
0
]
return
ret
[
0
]
else
:
# Ensure we preserve the original type of `wrt`.
if
using_tuple
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论