Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a6b12aad
提交
a6b12aad
authored
8月 14, 2017
作者:
Frédéric Bastien
提交者:
GitHub
8月 14, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6292 from nouiz/fix_ctc_test
Fix CTC tests in FAST_COMPILE
上级
dc9ac109
6c47fae4
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
25 行增加
和
5 行删除
+25
-5
ctc.txt
doc/library/gpuarray/ctc.txt
+7
-0
ctc.txt
doc/library/tensor/nnet/ctc.txt
+5
-0
requirements.inc
doc/requirements.inc
+7
-0
ctc.py
theano/gpuarray/ctc.py
+3
-2
test_ctc.py
theano/gpuarray/tests/test_ctc.py
+2
-2
ctc.py
theano/tensor/nnet/ctc.py
+1
-1
没有找到文件。
doc/library/gpuarray/ctc.txt
浏览文件 @
a6b12aad
...
@@ -4,6 +4,13 @@
...
@@ -4,6 +4,13 @@
:mod:`theano.gpuarray.ctc` -- Connectionist Temporal Classification (CTC) loss
:mod:`theano.gpuarray.ctc` -- Connectionist Temporal Classification (CTC) loss
================================================================================
================================================================================
.. warning::
This is not the recomanded user interface. Use :ref:`the CPU
interface <libdoc_tensor_nnet_ctc>`. It will get moved
automatically to the GPU.
.. note::
.. note::
Usage of connectionist temporal classification (CTC) loss Op, requires that
Usage of connectionist temporal classification (CTC) loss Op, requires that
...
...
doc/library/tensor/nnet/ctc.txt
浏览文件 @
a6b12aad
...
@@ -12,6 +12,11 @@
...
@@ -12,6 +12,11 @@
the ``config.ctc.root`` configuration option must be appropriately set to the
the ``config.ctc.root`` configuration option must be appropriately set to the
directory containing the warp-ctc library files.
directory containing the warp-ctc library files.
.. note::
This interface is the prefered interface. It will be moved
automatically to the GPU.
.. note::
.. note::
Unfortunately, Windows platforms are not yet supported by the underlying
Unfortunately, Windows platforms are not yet supported by the underlying
...
...
doc/requirements.inc
浏览文件 @
a6b12aad
...
@@ -13,6 +13,7 @@ Requirements
...
@@ -13,6 +13,7 @@ Requirements
..
_libgpuarray
:
http
://
deeplearning
.
net
/
software
/
libgpuarray
/
installation
.
html
..
_libgpuarray
:
http
://
deeplearning
.
net
/
software
/
libgpuarray
/
installation
.
html
..
_pycuda
:
https
://
mathema
.
tician
.
de
/
software
/
pycuda
/
..
_pycuda
:
https
://
mathema
.
tician
.
de
/
software
/
pycuda
/
..
_skcuda
:
http
://
scikit
-
cuda
.
readthedocs
.
io
/
en
/
latest
/
..
_skcuda
:
http
://
scikit
-
cuda
.
readthedocs
.
io
/
en
/
latest
/
..
_warp
-
ctc
:
https
://
github
.
com
/
baidu
-
research
/
warp
-
ctc
Python_
==
2.7
*
or
(
>=
3.4
and
<
3.6
)
Python_
==
2.7
*
or
(
>=
3.4
and
<
3.6
)
|
PythonDistRecommended
|.
Python
2.4
was
supported
up
to
and
including
the
|
PythonDistRecommended
|.
Python
2.4
was
supported
up
to
and
including
the
...
@@ -57,6 +58,12 @@ Requirements
...
@@ -57,6 +58,12 @@ Requirements
cusolver: ``pip install pycuda; pip install
cusolver: ``pip install pycuda; pip install
git+https://github.com/lebedov/scikit-cuda.git#egg=scikit-cuda``.
git+https://github.com/lebedov/scikit-cuda.git#egg=scikit-cuda``.
`warp-ctc`_
Required for :ref:`Theano CTC implementation
<libdoc_tensor_nnet_ctc>`. It is faster then using an
equivalent graph of Theano ops.
Requirements installation through Conda (recommended)
Requirements installation through Conda (recommended)
-----------------------------------------------------
-----------------------------------------------------
...
...
theano/gpuarray/ctc.py
浏览文件 @
a6b12aad
...
@@ -58,7 +58,8 @@ class GpuConnectionistTemporalClassification(gof.COp):
...
@@ -58,7 +58,8 @@ class GpuConnectionistTemporalClassification(gof.COp):
return
[
"warpctc"
,
"gpuarray"
]
return
[
"warpctc"
,
"gpuarray"
]
def
c_header_dirs
(
self
):
def
c_header_dirs
(
self
):
dirs
=
[
gpuarray_helper_inc_dir
(),
pygpu
.
get_include
()]
dirs
=
[
gpuarray_helper_inc_dir
(),
pygpu
.
get_include
(),
config
.
cuda
.
include_path
]
if
config
.
ctc
.
root
!=
''
:
if
config
.
ctc
.
root
!=
''
:
dirs
.
append
(
os
.
path
.
join
(
config
.
ctc
.
root
,
"include"
))
dirs
.
append
(
os
.
path
.
join
(
config
.
ctc
.
root
,
"include"
))
return
dirs
return
dirs
...
@@ -163,7 +164,7 @@ def gpu_ctc(activations, labels, input_lengths):
...
@@ -163,7 +164,7 @@ def gpu_ctc(activations, labels, input_lengths):
# Disable gradient computation if not needed
# Disable gradient computation if not needed
@register_canonicalize
@register_canonicalize
(
"fast_compile"
)
@local_optimizer
([
GpuConnectionistTemporalClassification
])
@local_optimizer
([
GpuConnectionistTemporalClassification
])
def
local_gpu_ctc_no_grad
(
node
):
def
local_gpu_ctc_no_grad
(
node
):
if
isinstance
(
node
.
op
,
GpuConnectionistTemporalClassification
):
if
isinstance
(
node
.
op
,
GpuConnectionistTemporalClassification
):
...
...
theano/gpuarray/tests/test_ctc.py
浏览文件 @
a6b12aad
...
@@ -49,7 +49,7 @@ class TestCTC(unittest.TestCase):
...
@@ -49,7 +49,7 @@ class TestCTC(unittest.TestCase):
# Symbolic gradient of CTC cost
# Symbolic gradient of CTC cost
gpu_ctc_grad
=
T
.
grad
(
T
.
mean
(
gpu_ctc_cost
),
activations
)
gpu_ctc_grad
=
T
.
grad
(
T
.
mean
(
gpu_ctc_cost
),
activations
)
outputs
+=
[
gpu_ctc_grad
]
outputs
+=
[
gpu_ctc_grad
]
return
theano
.
function
([],
outputs
)
return
theano
.
function
([],
outputs
,
mode
=
mode_with_gpu
)
def
check_expected_values
(
self
,
activations
,
labels
,
input_length
,
expected_costs
,
expected_grads
):
def
check_expected_values
(
self
,
activations
,
labels
,
input_length
,
expected_costs
,
expected_grads
):
gpu_train
=
self
.
setup_gpu_op
(
activations
,
labels
,
input_length
)
gpu_train
=
self
.
setup_gpu_op
(
activations
,
labels
,
input_length
)
...
@@ -139,4 +139,4 @@ class TestCTC(unittest.TestCase):
...
@@ -139,4 +139,4 @@ class TestCTC(unittest.TestCase):
ctc_op
=
ctc_op_functor
(
labels
,
activation_times
)
ctc_op
=
ctc_op_functor
(
labels
,
activation_times
)
utt
.
verify_grad
(
ctc_op
,
[
activations
])
utt
.
verify_grad
(
ctc_op
,
[
activations
]
,
mode
=
mode_with_gpu
)
theano/tensor/nnet/ctc.py
浏览文件 @
a6b12aad
...
@@ -224,7 +224,7 @@ def ctc(activations, labels, input_lengths):
...
@@ -224,7 +224,7 @@ def ctc(activations, labels, input_lengths):
# Disable gradient computation if not needed
# Disable gradient computation if not needed
@register_canonicalize
@register_canonicalize
(
'fast_compile'
)
@local_optimizer
([
ConnectionistTemporalClassification
])
@local_optimizer
([
ConnectionistTemporalClassification
])
def
local_ctc_no_grad
(
node
):
def
local_ctc_no_grad
(
node
):
if
isinstance
(
node
.
op
,
ConnectionistTemporalClassification
):
if
isinstance
(
node
.
op
,
ConnectionistTemporalClassification
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论