Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
3861ff60
提交
3861ff60
authored
11月 13, 2012
作者:
Ian Goodfellow
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
made unit tests work with new interface
上级
fdfcd78e
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
1 行删除
+10
-1
test_gradient.py
theano/tests/test_gradient.py
+10
-1
没有找到文件。
theano/tests/test_gradient.py
浏览文件 @
3861ff60
...
@@ -6,7 +6,6 @@ import unittest
...
@@ -6,7 +6,6 @@ import unittest
import
theano
import
theano
from
theano
import
gof
from
theano
import
gof
from
theano.gradient
import
grad_sources_inputs
from
theano
import
gradient
from
theano
import
gradient
from
theano.tensor.nnet.Conv3D
import
conv3D
from
theano.tensor.nnet.Conv3D
import
conv3D
from
theano
import
config
from
theano
import
config
...
@@ -16,6 +15,16 @@ from theano.gof.null_type import NullType
...
@@ -16,6 +15,16 @@ from theano.gof.null_type import NullType
one
=
theano
.
tensor
.
as_tensor_variable
(
1.
)
one
=
theano
.
tensor
.
as_tensor_variable
(
1.
)
def
grad_sources_inputs
(
sources
,
inputs
):
"""
This implements the old grad_sources_inputs function in terms of
the new interface so the tests don't need to be rewritten.
"""
if
inputs
is
None
:
inputs
=
theano
.
gof
.
graph
.
inputs
([
source
[
0
]
for
source
in
sources
])
return
dict
(
zip
(
inputs
,
theano
.
gradient
.
grad
(
cost
=
None
,
known_grads
=
dict
(
sources
),
wrt
=
inputs
,
consider_constant
=
inputs
)))
class
testgrad_sources_inputs
(
unittest
.
TestCase
):
class
testgrad_sources_inputs
(
unittest
.
TestCase
):
def
test_retNone1
(
self
):
def
test_retNone1
(
self
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论