提交 8292c229 authored 作者: Frederic Bastien's avatar Frederic Bastien

Make first version of update update about cudnn to have minimal RNN doc to email about it.

上级 e7eec307
......@@ -148,6 +148,7 @@ get an error when cuDNN can not be used with them, use this flag:
* :ref:`Convolution <libdoc_cuda_dnn_convolution>`
* :ref:`Pooling <libdoc_cuda_dnn_pooling>`
* :ref:`Batch Normalization <libdoc_cuda_dnn_bn>`
* :ref:`RNN <libdoc_cuda_dnn_rnn>`
* :ref:`Softmax <libdoc_cuda_dnn_softmax>`
* :ref:`Internal Ops <libdoc_cuda_dnn_internal_ops>`
......@@ -194,8 +195,8 @@ New back-end only! Without dropout support.
Softmax
=======
You can manually use the op :ref:`GpuDnnSoftmax
<theano.sandbox.cuda.dnn.GpuDnnSoftmax>` to use its extra feature.
You can manually use the op `GpuDnnSoftmax
<theano.sandbox.cuda.dnn.GpuDnnSoftmax>`_ to use its extra feature.
.. _libdoc_cuda_dnn_internal_ops:
......@@ -208,4 +209,4 @@ Internal Ops
GpuDnnConv3dGradW, GpuDnnConvGradI, GpuDnnConv3dGradI,
GpuDnnPoolDesc, GpuDnnPool, GpuDnnPoolGrad,
GpuDnnBatchNormInference, GpuDnnBatchNorm, GpuDnnBatchNormGrad,
GpuDnnSoftmax, GpuDnnSoftmaxGrad,
GpuDnnSoftmax, GpuDnnSoftmaxGrad
......@@ -2337,25 +2337,34 @@ 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 that test until we have it.
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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论