Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d382ccc7
提交
d382ccc7
authored
1月 19, 2011
作者:
Ian Goodfellow
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added version numbers to the Conv3D ops
上级
6f2a1b03
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
17 行增加
和
0 行删除
+17
-0
basic.py
theano/tensor/basic.py
+3
-0
Conv3D.py
theano/tensor/nnet/Conv3D.py
+4
-0
ConvGrad3D.py
theano/tensor/nnet/ConvGrad3D.py
+7
-0
ConvTransp3D.py
theano/tensor/nnet/ConvTransp3D.py
+3
-0
没有找到文件。
theano/tensor/basic.py
浏览文件 @
d382ccc7
...
@@ -4414,6 +4414,7 @@ class numeric_grad:
...
@@ -4414,6 +4414,7 @@ class numeric_grad:
x
[
i
]
+=
eps
x
[
i
]
+=
eps
f_eps
=
f
(
*
apt
)
f_eps
=
f
(
*
apt
)
gx
[
i
]
=
numpy
.
asarray
((
f_eps
-
f_x
)
/
eps
)
gx
[
i
]
=
numpy
.
asarray
((
f_eps
-
f_x
)
/
eps
)
if
packed_pt
:
if
packed_pt
:
...
@@ -4594,6 +4595,7 @@ def verify_grad(fun, pt, n_tests=2, rng=None, eps=None, abs_tol=None, rel_tol=No
...
@@ -4594,6 +4595,7 @@ def verify_grad(fun, pt, n_tests=2, rng=None, eps=None, abs_tol=None, rel_tol=No
for
test_num
in
xrange
(
n_tests
):
for
test_num
in
xrange
(
n_tests
):
num_grad
=
numeric_grad
(
cost_fn
,
[
p
.
copy
()
for
p
in
pt
],
eps
)
num_grad
=
numeric_grad
(
cost_fn
,
[
p
.
copy
()
for
p
in
pt
],
eps
)
analytic_grad
=
grad_fn
(
*
[
p
.
copy
()
for
p
in
pt
])
analytic_grad
=
grad_fn
(
*
[
p
.
copy
()
for
p
in
pt
])
if
not
isinstance
(
analytic_grad
,
(
list
,
tuple
)):
if
not
isinstance
(
analytic_grad
,
(
list
,
tuple
)):
...
@@ -4621,6 +4623,7 @@ class GradientError(Exception):
...
@@ -4621,6 +4623,7 @@ class GradientError(Exception):
self
.
abs_tol
=
abs_tol
self
.
abs_tol
=
abs_tol
self
.
rel_tol
=
rel_tol
self
.
rel_tol
=
rel_tol
def
__str__
(
self
):
def
__str__
(
self
):
return
"""GradientError: numeric gradient and analytic gradient exceed tolerance:
return
"""GradientError: numeric gradient and analytic gradient exceed tolerance:
At position
%
i of argument
%
i,
At position
%
i of argument
%
i,
...
...
theano/tensor/nnet/Conv3D.py
浏览文件 @
d382ccc7
...
@@ -49,6 +49,10 @@ class Conv3D(theano.Op):
...
@@ -49,6 +49,10 @@ class Conv3D(theano.Op):
def
__str__
(
self
):
def
__str__
(
self
):
return
"Conv3D"
return
"Conv3D"
def
c_code_cache_version
(
self
):
return
(
1
,)
def
make_node
(
self
,
V
,
W
,
b
,
d
):
def
make_node
(
self
,
V
,
W
,
b
,
d
):
"""
"""
:param V: Visible unit, input(batch,row,column,time,in channel)
:param V: Visible unit, input(batch,row,column,time,in channel)
...
...
theano/tensor/nnet/ConvGrad3D.py
浏览文件 @
d382ccc7
...
@@ -3,6 +3,10 @@ from theano.tensor import basic as T
...
@@ -3,6 +3,10 @@ from theano.tensor import basic as T
from
theano.misc
import
strutil
from
theano.misc
import
strutil
import
numpy
as
N
import
numpy
as
N
#TODO: speed up by reordering loops. Should pass through the videos once, incrementing all weight gradients, rather
# than visiting each weight gradient element once and passing through whole video
class
ConvGrad3D
(
theano
.
Op
):
class
ConvGrad3D
(
theano
.
Op
):
""" Gradient of Conv3D with respect to W """
""" Gradient of Conv3D with respect to W """
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
...
@@ -11,6 +15,9 @@ class ConvGrad3D(theano.Op):
...
@@ -11,6 +15,9 @@ class ConvGrad3D(theano.Op):
def
__hash__
(
self
):
def
__hash__
(
self
):
return
hash
(
type
(
self
))
return
hash
(
type
(
self
))
def
c_code_cache_version
(
self
):
return
(
1
,)
def
make_node
(
self
,
V
,
d
,
WShape
,
dCdH
):
def
make_node
(
self
,
V
,
d
,
WShape
,
dCdH
):
V_
=
T
.
as_tensor_variable
(
V
)
V_
=
T
.
as_tensor_variable
(
V
)
d_
=
T
.
as_tensor_variable
(
d
)
d_
=
T
.
as_tensor_variable
(
d
)
...
...
theano/tensor/nnet/ConvTransp3D.py
浏览文件 @
d382ccc7
...
@@ -11,6 +11,9 @@ class ConvTransp3D(theano.Op):
...
@@ -11,6 +11,9 @@ class ConvTransp3D(theano.Op):
def
__hash__
(
self
):
def
__hash__
(
self
):
return
hash
(
type
(
self
))
return
hash
(
type
(
self
))
def
c_code_cache_version
(
self
):
return
(
1
,)
def
make_node
(
self
,
W
,
b
,
d
,
H
,
RShape
=
None
):
def
make_node
(
self
,
W
,
b
,
d
,
H
,
RShape
=
None
):
"""
"""
:param W: Weights, filter
:param W: Weights, filter
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论