Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ed170280
提交
ed170280
authored
2月 05, 2016
作者:
Vincent Michalski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
applied changes suggested by lamblin and nouiz
上级
6f030393
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
14 行增加
和
9 行删除
+14
-9
conv3d2d.py
theano/tensor/nnet/conv3d2d.py
+6
-4
nnet.py
theano/tensor/nnet/nnet.py
+1
-2
sigm.py
theano/tensor/nnet/sigm.py
+7
-3
没有找到文件。
theano/tensor/nnet/conv3d2d.py
浏览文件 @
ed170280
...
...
@@ -329,9 +329,11 @@ def make_gpu_optimizer(op, to_gpu):
new_inp
=
list
(
node
.
inputs
)
for
idx
in
to_gpu
:
new_inp
[
idx
]
=
cuda
.
gpu_from_host
(
new_inp
[
idx
])
new_node
=
cuda
.
host_from_gpu
(
op
()(
*
new_inp
))
copy_stack_trace
(
node
.
outputs
[
0
],
new_node
)
return
[
new_node
]
result_node
=
op
()(
*
new_inp
)
copy_stack_trace
(
node
.
outputs
[
0
],
result_node
)
transfer_node
=
cuda
.
host_from_gpu
(
result_node
)
copy_stack_trace
(
node
.
outputs
[
0
],
transfer_node
)
return
[
transfer_node
]
if
node
.
op
==
cuda
.
gpu_from_host
:
# gpu_from_host(op) -> op(gpu_from_host)
host_input
=
node
.
inputs
[
0
]
...
...
@@ -342,7 +344,7 @@ def make_gpu_optimizer(op, to_gpu):
for
idx
in
to_gpu
:
new_inp
[
idx
]
=
cuda
.
gpu_from_host
(
new_inp
[
idx
])
new_node
=
op
()(
*
new_inp
)
copy_stack_trace
(
node
.
outputs
[
0
]
,
new_node
)
copy_stack_trace
(
host_input
,
new_node
)
return
[
new_node
]
return
False
local_to_gpu
.
__name__
=
"local_to_gpu_"
+
op
.
__name__
...
...
theano/tensor/nnet/nnet.py
浏览文件 @
ed170280
...
...
@@ -753,7 +753,7 @@ def local_logsoftmax(node):
new_op
=
LogSoftmax
()
ret
=
new_op
(
inVars
)
ret
.
tag
.
values_eq_approx
=
values_eq_approx_remove_inf
copy_stack_trace
(
node
.
outputs
[
0
],
ret
)
copy_stack_trace
(
[
node
.
inputs
[
0
],
node
.
outputs
[
0
]
],
ret
)
return
[
ret
]
...
...
@@ -867,7 +867,6 @@ def local_softmax_with_bias(node):
if
sm_bias
.
type
==
node
.
outputs
[
0
]
.
type
:
# This condition is not always true. See the test
# nnet/tests/test_nnet.py:T_SoftmaxWithBias.test_broadcast
copy_stack_trace
(
node
.
outputs
[
0
],
sm_bias
)
return
[
sm_bias
]
...
...
theano/tensor/nnet/sigm.py
浏览文件 @
ed170280
...
...
@@ -955,8 +955,12 @@ def local_inv_1_plus_exp(node):
sigmoid
(
tensor
.
neg
(
nonconsts
[
0
]
.
owner
.
inputs
[
0
])),
scalar_inputs
)
# keep stack trace
copy_stack_trace
(
node
.
outputs
[
0
],
out
)
# keep combined stack traces of
# exp(x): nonconsts[0],
# 1 + exp(x): inv_arg,
# 1 / (1 + exp(x)): node.outputs[0]
copy_stack_trace
(
[
nonconsts
[
0
],
inv_arg
,
node
.
outputs
[
0
]],
out
)
return
out
# Registration is below, and conditional.
...
...
@@ -979,7 +983,7 @@ def local_1msigmoid(node):
return
if
numpy
.
allclose
(
numpy
.
sum
(
val_l
),
1
):
out
=
sigmoid
(
-
sub_r
.
owner
.
inputs
[
0
])
copy_stack_trace
(
node
.
outputs
[
0
],
out
)
copy_stack_trace
(
[
sub_r
,
node
.
outputs
[
0
]
],
out
)
return
[
out
]
register_local_1msigmoid
=
False
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论