Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
054f4f62
提交
054f4f62
authored
10月 26, 2016
作者:
Frédéric Bastien
提交者:
GitHub
10月 26, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5119 from nouiz/doc
Doc update about cudnn and cudnn RNN.
上级
25f0dee3
48a8413c
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
84 行增加
和
86 行删除
+84
-86
NEWS_DEV.txt
NEWS_DEV.txt
+2
-1
dnn.txt
doc/library/gpuarray/dnn.txt
+20
-26
dnn.txt
doc/library/sandbox/cuda/dnn.txt
+22
-40
bn.txt
doc/library/tensor/nnet/bn.txt
+1
-2
dnn.py
theano/gpuarray/dnn.py
+38
-16
dnn.py
theano/sandbox/cuda/dnn.py
+1
-1
没有找到文件。
NEWS_DEV.txt
浏览文件 @
054f4f62
...
...
@@ -18,7 +18,8 @@ Highlight:
Computation and compilation speed up
Multi-cores convolution and pooling on CPU
More numerical stability by default for some graph.
CuDNN: 5.1, batch normalization, (RNN soon)
New 3d convolution and pooling interface
CuDNN: 5.1, batch normalization, RNN
Dilated convolution
Multiple-GPU, synchrone update (via platoon, use NCCL)
Partial function evaluation
...
...
doc/library/gpuarray/dnn.txt
浏览文件 @
054f4f62
.. _libdoc_gpuarray_dnn:
===========================================
:mod:`gpuarray.dnn` -- cuDNN
:mod:`
theano.
gpuarray.dnn` -- cuDNN
===========================================
.. moduleauthor:: LISA
...
...
@@ -43,7 +43,7 @@ To get an error if Theano can not use cuDNN, use this Theano flag:
.. note::
cuDNN v5
rc
is supported in Theano master version. So it dropped cuDNN v3 support.
cuDNN v5
.1
is supported in Theano master version. So it dropped cuDNN v3 support.
Theano 0.8.0 and 0.8.1 support only cuDNN v3 and v4.
Theano 0.8.2 will support only v4 and v5.
...
...
@@ -132,30 +132,24 @@ To get an error if Theano can not use cuDNN, use this Theano flag:
cudnn.h must be readable by everybody.
Functions
=========
- Convolution:
- :func:`theano.gpuarray.dnn.dnn_conv`, :func:`theano.gpuarray.dnn.dnn_conv3d`.
- :func:`theano.gpuarray.dnn.dnn_gradweight`, :func:`theano.gpuarray.dnn.dnn_gradweight3d`.
- :func:`theano.gpuarray.dnn.dnn_gradinput`, :func:`theano.gpuarray.dnn.dnn_gradinput3d`.
- Pooling:
- :func:`theano.gpuarray.dnn.dnn_pool`.
- Batch Normalization:
- :func:`theano.gpuarray.dnn.dnn_batch_normalization_train`
- :func:`theano.gpuarray.dnn.dnn_batch_normalization_test`.
- RNN:
- :class:`theano.gpuarray.dnn.RNNBlock`
- Softmax:
- You can manually use the op :class:`GpuDnnSoftmax
<theano.gpuarray.dnn.GpuDnnSoftmax>` to use its extra feature.
List of Implemented Operations
==============================
.. automodule:: theano.gpuarray.dnn
:noindex:
:members: dnn_conv, dnn_pool
:members:
Convolution Ops
===============
.. automodule:: theano.gpuarray.dnn
:noindex:
:members: GpuDnnConvDesc, GpuDnnConv, GpuDnnConvGradW, GpuDnnConvGradI
Pooling Ops
===========
.. automodule:: theano.gpuarray.dnn
:noindex:
:members: GpuDnnPoolDesc, GpuDnnPool, GpuDnnPoolGrad
Softmax Ops
===========
.. automodule:: theano.gpuarray.dnn
:noindex:
:members: GpuDnnSoftmax, GpuDnnSoftmaxGrad
doc/library/sandbox/cuda/dnn.txt
浏览文件 @
054f4f62
.. _libdoc_cuda_dnn:
================================
:mod:`sandbox.cuda.dnn` -- cuDNN
================================
================================
=======
:mod:`
theano.
sandbox.cuda.dnn` -- cuDNN
================================
=======
.. moduleauthor:: LISA
`cuDNN <https://developer.nvidia.com/cuDNN>`_ is an NVIDIA library with
functionality used by deep neural network. It provides optimized versions
of some operations like the convolution. cuDNN is not currently
installed with CUDA
6.5
. You must download and install it
installed with CUDA. You must download and install it
yourself.
To install it, decompress the downloaded file and make the ``*.h`` and
...
...
@@ -46,7 +46,7 @@ get an error when cuDNN can not be used with them, use this flag:
.. note::
cuDNN v5
rc
is supported in Theano master version. So it dropped cuDNN v3 support.
cuDNN v5
.1
is supported in Theano master version. So it dropped cuDNN v3 support.
Theano 0.8.0 and 0.8.1 support only cuDNN v3 and v4.
Theano 0.8.2 will support only v4 and v5.
...
...
@@ -145,42 +145,24 @@ get an error when cuDNN can not be used with them, use this flag:
cudnn.h must be readable by everybody.
Functions
=========
- Convolution:
- :func:`theano.sandbox.cuda.dnn.dnn_conv`, :func:`theano.sandbox.cuda.dnn.dnn_conv3d`.
- :func:`theano.sandbox.cuda.dnn.dnn_gradweight`.
- :func:`theano.sandbox.cuda.dnn.dnn_gradinput`.
- Pooling:
- :func:`theano.sandbox.cuda.dnn.dnn_pool`.
- Batch Normalization:
- :func:`theano.sandbox.cuda.dnn.dnn_batch_normalization_train`
- :func:`theano.sandbox.cuda.dnn.dnn_batch_normalization_test`.
- RNN:
- :class:`New back-end only! <theano.gpuarray.dnn.RNNBlock>`.
- Softmax:
- You can manually use the op :class:`GpuDnnSoftmax
<theano.sandbox.cuda.dnn.GpuDnnSoftmax>` to use its extra feature.
.. automodule:: theano.sandbox.cuda.dnn
:noindex:
:members: dnn_conv, dnn_pool, dnn_conv3d, dnn_gradweight, dnn_gradinput, dnn_pool, dnn_batch_normalization_train, dnn_batch_normalization_test
Convolution Ops
===============
.. automodule:: theano.sandbox.cuda.dnn
:noindex:
:members: GpuDnnConvDesc, GpuDnnConv, GpuDnnConv3d, GpuDnnConvGradW,
GpuDnnConv3dGradW, GpuDnnConvGradI, GpuDnnConv3dGradI
Pooling Ops
===========
.. automodule:: theano.sandbox.cuda.dnn
:noindex:
:members: GpuDnnPoolDesc, GpuDnnPool, GpuDnnPoolGrad
Softmax Ops
===========
.. automodule:: theano.sandbox.cuda.dnn
:noindex:
:members: GpuDnnSoftmax, GpuDnnSoftmaxGrad
.. _libdoc_cuda_dnn_bn:
Batch Normalization
===================
List of Implemented Operations
===================
===========
.. automodule:: theano.sandbox.cuda.dnn
:noindex:
:members: dnn_batch_normalization_train, dnn_batch_normalization_test
:members:
doc/library/tensor/nnet/bn.txt
浏览文件 @
054f4f62
...
...
@@ -10,7 +10,6 @@
.. moduleauthor:: LISA
.. seealso:: :ref:`cuDNN batch normalization <libdoc_cuda_dnn_bn>`
must be added manually.
.. seealso:: cuDNN batch normalization: :class:`theano.gpuarray.dnn.dnn_batch_normalization_train`, :class:`theano.gpuarray.dnn.dnn_batch_normalization_test>`. They must be added manually as they do not have the same user interface.
.. autofunction:: theano.tensor.nnet.bn.batch_normalization
theano/gpuarray/dnn.py
浏览文件 @
054f4f62
...
...
@@ -1142,6 +1142,9 @@ def dnn_conv3d(img, kerns, border_mode='valid', subsample=(1, 1, 1),
def
dnn_gradweight
(
img
,
topgrad
,
kerns_shp
,
border_mode
=
'valid'
,
subsample
=
(
1
,
1
),
conv_mode
=
'conv'
):
"""
TODO: document this
"""
ctx_name
=
infer_context_name
(
img
,
topgrad
)
img
=
as_gpuarray_variable
(
img
,
ctx_name
)
topgrad
=
as_gpuarray_variable
(
topgrad
,
ctx_name
)
...
...
@@ -1156,6 +1159,9 @@ def dnn_gradweight(img, topgrad, kerns_shp, border_mode='valid',
def
dnn_gradweight3d
(
img
,
topgrad
,
kerns_shp
,
border_mode
=
'valid'
,
subsample
=
(
1
,
1
,
1
),
conv_mode
=
'conv'
):
"""
TODO: document this
"""
ctx_name
=
infer_context_name
(
img
,
topgrad
)
img
=
as_gpuarray_variable
(
img
,
ctx_name
)
topgrad
=
as_gpuarray_variable
(
topgrad
,
ctx_name
)
...
...
@@ -1170,6 +1176,9 @@ def dnn_gradweight3d(img, topgrad, kerns_shp, border_mode='valid',
def
dnn_gradinput
(
kerns
,
topgrad
,
img_shp
,
border_mode
=
'valid'
,
subsample
=
(
1
,
1
),
conv_mode
=
'conv'
):
"""
TODO: document this
"""
ctx_name
=
infer_context_name
(
kerns
,
topgrad
)
kerns
=
as_gpuarray_variable
(
kerns
,
ctx_name
)
topgrad
=
as_gpuarray_variable
(
topgrad
,
ctx_name
)
...
...
@@ -1184,6 +1193,9 @@ def dnn_gradinput(kerns, topgrad, img_shp, border_mode='valid',
def
dnn_gradinput3d
(
kerns
,
topgrad
,
img_shp
,
border_mode
=
'valid'
,
subsample
=
(
1
,
1
,
1
),
conv_mode
=
'conv'
):
"""
TODO: document this
"""
ctx_name
=
infer_context_name
(
kerns
,
topgrad
)
kerns
=
as_gpuarray_variable
(
kerns
,
ctx_name
)
topgrad
=
as_gpuarray_variable
(
topgrad
,
ctx_name
)
...
...
@@ -2337,25 +2349,35 @@ class GpuDnnRNNGradWeights(DnnBase):
class
RNNBlock
(
object
):
"""
An object that allow us to use CuDNN v5 RNN implementation.
TODO: make an example how to use. You can check Theano tests
test_dnn_rnn_gru() and test_dnn_rnn_lstm() in the file
theano/gpuarray/tests/test_dnn.py for now.
Parameters
----------
dtype : data type of computation
hidden_size : int
num_layers : int
rnn_mode : {'rnn_relu', 'rnn_tanh', 'lstm', 'gru'}
See cudnn documentation for ``cudnnRNNMode_t``.
input_mode : {'linear', 'skip'}
linear: input will be multiplied by a biased matrix
skip: No operation is performed on the input. The size must match the hidden size.
direction_mode : {'unidirectional', 'bidirectional'}
unidirectional: The network operates recurrently from the
first input to the last.
bidirectional: The network operates from first to last then from last to first and concatenates the results at each layer.
"""
def
__init__
(
self
,
dtype
,
hidden_size
,
num_layers
,
rnn_mode
,
input_mode
=
'linear'
,
direction_mode
=
'unidirectional'
,
context_name
=
None
):
"""
dtype: data type of computation
hidden_size: int
num_layers: int
rnn_mode: {'rnn_relu', 'rnn_tanh', 'lstm', 'gru'}
See cudnn documentation for cudnnRNNMode_t.
input_mode: {'linear', 'skip'}
linear: input will be multiplied by a biased matrix
skip: No operation is performed on the input. The size must match the hidden size.
direction_mode: {'unidirectional', 'bidirectional'}
unidirectional: The network operates recurrently from the
first input to the last.
bidirectional: The network operates from first to last then from last to first and concatenates the results at each layer.
"""
# This is not supported for any value other than 0, so don't change it
ddesc
,
states
=
_make_dropout_desc
(
0
,
4242
,
context_name
)
self
.
ddesc
=
ddesc
...
...
theano/sandbox/cuda/dnn.py
浏览文件 @
054f4f62
...
...
@@ -1424,7 +1424,7 @@ class GpuDnnPoolDesc(GpuOp):
Note
----
Not used
anymore. Only needed to reload old pickled files.
Do not use
anymore. Only needed to reload old pickled files.
"""
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论