Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6ef5d264
提交
6ef5d264
authored
2月 06, 2014
作者:
Pierre Luc Carrier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adapt tests for the ops GpuSoftmax and GpuSoftmaxWithBias and register them in opt.py.
上级
a8c08487
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
14 行增加
和
3 行删除
+14
-3
opt.py
theano/sandbox/gpuarray/opt.py
+12
-1
test_nnet.py
theano/sandbox/gpuarray/tests/test_nnet.py
+2
-2
没有找到文件。
theano/sandbox/gpuarray/opt.py
浏览文件 @
6ef5d264
...
@@ -20,7 +20,9 @@ from theano.sandbox.gpuarray.basic_ops import (host_from_gpu,
...
@@ -20,7 +20,9 @@ from theano.sandbox.gpuarray.basic_ops import (host_from_gpu,
from
theano.sandbox.gpuarray.blas
import
gpu_dot22
,
GpuGemv
,
GpuGemm
from
theano.sandbox.gpuarray.blas
import
gpu_dot22
,
GpuGemv
,
GpuGemm
from
theano.sandbox.gpuarray.conv
import
GpuConv
from
theano.sandbox.gpuarray.conv
import
GpuConv
from
theano.sandbox.gpuarray.nnet
import
(
GpuCrossentropySoftmaxArgmax1HotWithBias
,
from
theano.sandbox.gpuarray.nnet
import
(
GpuCrossentropySoftmaxArgmax1HotWithBias
,
GpuCrossentropySoftmax1HotWithBiasDx
)
GpuCrossentropySoftmax1HotWithBiasDx
,
GpuSoftmaxWithBias
,
GpuSoftmax
)
from
theano.sandbox.gpuarray.elemwise
import
(
GpuElemwise
,
_is_scalar
,
from
theano.sandbox.gpuarray.elemwise
import
(
GpuElemwise
,
_is_scalar
,
GpuDimShuffle
,
GpuCAReduceCuda
)
GpuDimShuffle
,
GpuCAReduceCuda
)
from
theano.sandbox.gpuarray.subtensor
import
GpuIncSubtensor
,
GpuSubtensor
from
theano.sandbox.gpuarray.subtensor
import
GpuIncSubtensor
,
GpuSubtensor
...
@@ -341,6 +343,15 @@ def local_gpua_crossentropysoftmaxargmax1hotwithbias(node):
...
@@ -341,6 +343,15 @@ def local_gpua_crossentropysoftmaxargmax1hotwithbias(node):
def
local_gpua_crossentropysoftmax1hotwithbiasdx
(
node
):
def
local_gpua_crossentropysoftmax1hotwithbiasdx
(
node
):
return
GpuCrossentropySoftmax1HotWithBiasDx
()
return
GpuCrossentropySoftmax1HotWithBiasDx
()
@register_opt
()
@op_lifter
([
tensor
.
nnet
.
GpuSoftmax
])
def
local_gpua_softmax
(
node
):
return
GpuSoftmax
()
@register_opt
()
@op_lifter
([
tensor
.
nnet
.
GpuSoftmaxWithBias
])
def
local_gpua_softmaxwithbias
(
node
):
return
GpuSoftmaxWithBias
()
@register_opt
()
@register_opt
()
@op_lifter
([
gpu_from_host
,
ConvOp
])
@op_lifter
([
gpu_from_host
,
ConvOp
])
...
...
theano/sandbox/gpuarray/tests/test_nnet.py
浏览文件 @
6ef5d264
...
@@ -178,7 +178,7 @@ def test_softmax_with_bias():
...
@@ -178,7 +178,7 @@ def test_softmax_with_bias():
f_gpu
=
theano
.
function
([
x
],
z
,
mode
=
mode_with_gpu
)
f_gpu
=
theano
.
function
([
x
],
z
,
mode
=
mode_with_gpu
)
assert
f
.
maker
.
fgraph
.
toposort
()[
-
1
]
.
op
==
T
.
nnet
.
softmax_with_bias
assert
f
.
maker
.
fgraph
.
toposort
()[
-
1
]
.
op
==
T
.
nnet
.
softmax_with_bias
assert
isinstance
(
f_gpu
.
maker
.
fgraph
.
toposort
()[
-
2
]
.
op
,
assert
isinstance
(
f_gpu
.
maker
.
fgraph
.
toposort
()[
-
2
]
.
op
,
cuda
.
nnet
.
GpuSoftmaxWithBias
)
theano
.
sandbox
.
gpuarray
.
nnet
.
GpuSoftmaxWithBias
)
def
cmp
(
n
,
m
):
def
cmp
(
n
,
m
):
#print "test_softmax",n,m
#print "test_softmax",n,m
...
@@ -219,7 +219,7 @@ def test_softmax():
...
@@ -219,7 +219,7 @@ def test_softmax():
f_gpu
=
theano
.
function
([
x
],
z
,
mode
=
mode_with_gpu
)
f_gpu
=
theano
.
function
([
x
],
z
,
mode
=
mode_with_gpu
)
assert
f
.
maker
.
fgraph
.
toposort
()[
-
1
]
.
op
==
T
.
nnet
.
softmax
assert
f
.
maker
.
fgraph
.
toposort
()[
-
1
]
.
op
==
T
.
nnet
.
softmax
assert
isinstance
(
f_gpu
.
maker
.
fgraph
.
toposort
()[
-
2
]
.
op
,
assert
isinstance
(
f_gpu
.
maker
.
fgraph
.
toposort
()[
-
2
]
.
op
,
cuda
.
nnet
.
GpuSoftmax
)
theano
.
sandbox
.
gpuarray
.
nnet
.
GpuSoftmax
)
def
cmp
(
n
,
m
):
def
cmp
(
n
,
m
):
#print "test_softmax",n,m
#print "test_softmax",n,m
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论