Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6f2a1b03
提交
6f2a1b03
authored
1月 18, 2011
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add detail to comment and coding style change.
上级
d21d8bd2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
15 行增加
和
15 行删除
+15
-15
Conv3D.py
theano/tensor/nnet/Conv3D.py
+7
-7
ConvTransp3D.py
theano/tensor/nnet/ConvTransp3D.py
+8
-8
没有找到文件。
theano/tensor/nnet/Conv3D.py
浏览文件 @
6f2a1b03
...
@@ -51,10 +51,10 @@ class Conv3D(theano.Op):
...
@@ -51,10 +51,10 @@ class Conv3D(theano.Op):
def
make_node
(
self
,
V
,
W
,
b
,
d
):
def
make_node
(
self
,
V
,
W
,
b
,
d
):
"""
"""
:param V: Visible unit, input
:param V: Visible unit, input
(batch,row,column,time,in channel)
:param W: Weights, filter
:param W: Weights, filter
(out channel,row,column,time,in channel)
:param b: bias, shape == (W.shape[0],)
:param b: bias, shape == (W.shape[0],)
:param d: strides when moving the filter over the input
:param d: strides when moving the filter over the input
(dx,dy,dt)
"""
"""
V_
=
T
.
as_tensor_variable
(
V
)
V_
=
T
.
as_tensor_variable
(
V
)
...
@@ -82,22 +82,22 @@ class Conv3D(theano.Op):
...
@@ -82,22 +82,22 @@ class Conv3D(theano.Op):
dCdb
=
T
.
sum
(
dCdH
,
axis
=
(
0
,
1
,
2
,
3
))
dCdb
=
T
.
sum
(
dCdH
,
axis
=
(
0
,
1
,
2
,
3
))
dCdd
=
None
#not differentiable, since d is not continuous
dCdd
=
None
#not differentiable, since d is not continuous
if
'name'
in
dir
(
dCdH
)
and
dCdH
.
name
!=
None
:
if
'name'
in
dir
(
dCdH
)
and
dCdH
.
name
is
not
None
:
dCdH_name
=
dCdH
.
name
dCdH_name
=
dCdH
.
name
else
:
else
:
dCdH_name
=
'anon'
dCdH_name
=
'anon'
if
'name'
in
dir
(
V
)
and
V
.
name
!=
None
:
if
'name'
in
dir
(
V
)
and
V
.
name
is
not
None
:
V_name
=
V
.
name
V_name
=
V
.
name
else
:
else
:
V_name
=
'anon'
V_name
=
'anon'
if
'name'
in
dir
(
W
)
and
W
.
name
!=
None
:
if
'name'
in
dir
(
W
)
and
W
.
name
is
not
None
:
W_name
=
W
.
name
W_name
=
W
.
name
else
:
else
:
W_name
=
'anon'
W_name
=
'anon'
if
'name'
in
dir
(
b
)
and
b
.
name
!=
None
:
if
'name'
in
dir
(
b
)
and
b
.
name
is
not
None
:
b_name
=
b
.
name
b_name
=
b
.
name
else
:
else
:
b_name
=
'anon'
b_name
=
'anon'
...
...
theano/tensor/nnet/ConvTransp3D.py
浏览文件 @
6f2a1b03
...
@@ -50,22 +50,22 @@ class ConvTransp3D(theano.Op):
...
@@ -50,22 +50,22 @@ class ConvTransp3D(theano.Op):
dCdRShape
=
None
#not differentiable, since RShape is not continuous
dCdRShape
=
None
#not differentiable, since RShape is not continuous
if
'name'
in
dir
(
dCdR
)
and
dCdR
.
name
!=
None
:
if
'name'
in
dir
(
dCdR
)
and
dCdR
.
name
is
not
None
:
dCdR_name
=
dCdR
.
name
dCdR_name
=
dCdR
.
name
else
:
else
:
dCdR_name
=
'anon'
dCdR_name
=
'anon'
if
'name'
in
dir
(
H
)
and
H
.
name
!=
None
:
if
'name'
in
dir
(
H
)
and
H
.
name
is
not
None
:
H_name
=
H
.
name
H_name
=
H
.
name
else
:
else
:
H_name
=
'anon'
H_name
=
'anon'
if
'name'
in
dir
(
W
)
and
W
.
name
!=
None
:
if
'name'
in
dir
(
W
)
and
W
.
name
is
not
None
:
W_name
=
W
.
name
W_name
=
W
.
name
else
:
else
:
W_name
=
'anon'
W_name
=
'anon'
if
'name'
in
dir
(
b
)
and
b
.
name
!=
None
:
if
'name'
in
dir
(
b
)
and
b
.
name
is
not
None
:
b_name
=
b
.
name
b_name
=
b
.
name
else
:
else
:
b_name
=
'anon'
b_name
=
'anon'
...
@@ -79,9 +79,9 @@ class ConvTransp3D(theano.Op):
...
@@ -79,9 +79,9 @@ class ConvTransp3D(theano.Op):
def
perform
(
self
,
node
,
inputs
,
output_storage
):
def
perform
(
self
,
node
,
inputs
,
output_storage
):
W
,
b
,
d
,
H
,
RShape
=
inputs
W
,
b
,
d
,
H
,
RShape
=
inputs
print
"
\t\t\t\t
ConvTransp3D python code"
print
"
\t\t\t\t
ConvTransp3D python code"
output_storage
[
0
][
0
]
=
computeR
(
W
,
b
,
d
,
H
,
RShape
)
output_storage
[
0
][
0
]
=
computeR
(
W
,
b
,
d
,
H
,
RShape
)
def
c_code
(
self
,
node
,
nodename
,
(
W
,
b
,
d
,
H
,
RShape
),
outputs
,
sub
):
def
c_code
(
self
,
node
,
nodename
,
(
W
,
b
,
d
,
H
,
RShape
),
outputs
,
sub
):
fail
=
sub
[
'fail'
]
fail
=
sub
[
'fail'
]
...
@@ -360,7 +360,7 @@ def computeR(W,b,d,H,Rshape = None):
...
@@ -360,7 +360,7 @@ def computeR(W,b,d,H,Rshape = None):
videoWidth
=
(
outputWidth
-
1
)
*
dc
+
filterWidth
videoWidth
=
(
outputWidth
-
1
)
*
dc
+
filterWidth
videoDur
=
(
outputDur
-
1
)
*
dt
+
filterDur
videoDur
=
(
outputDur
-
1
)
*
dt
+
filterDur
if
Rshape
!=
None
and
Rshape
[
0
]
!=
-
1
:
if
Rshape
is
not
None
and
Rshape
[
0
]
!=
-
1
:
if
Rshape
[
0
]
<
videoHeight
:
if
Rshape
[
0
]
<
videoHeight
:
print
(
Rshape
[
0
],
videoHeight
)
print
(
Rshape
[
0
],
videoHeight
)
assert
False
assert
False
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论