提交 7377c59b 编写于 作者: C Cao Ying 提交者: GitHub

Merge pull request #2200 from luotao1/agg_level

add doc for AggregateLevel and ExpandLevel.
...@@ -207,6 +207,11 @@ trans_full_matrix_projection ...@@ -207,6 +207,11 @@ trans_full_matrix_projection
Aggregate Layers Aggregate Layers
================ ================
AggregateLevel
--------------
.. autoclass:: paddle.v2.layer.AggregateLevel
:noindex:
.. _api_v2.layer_pooling: .. _api_v2.layer_pooling:
pooling pooling
...@@ -248,6 +253,11 @@ block_expand ...@@ -248,6 +253,11 @@ block_expand
.. _api_v2.layer_expand: .. _api_v2.layer_expand:
ExpandLevel
-----------
.. autoclass:: paddle.v2.layer.ExpandLevel
:noindex:
expand expand
------ ------
.. autoclass:: paddle.v2.layer.expand .. autoclass:: paddle.v2.layer.expand
......
...@@ -225,6 +225,24 @@ class LayerType(object): ...@@ -225,6 +225,24 @@ class LayerType(object):
class AggregateLevel(object): class AggregateLevel(object):
"""
PaddlePaddle supports three sequence types:
- :code:`SequenceType.NO_SEQUENCE` means the sample is not a sequence.
- :code:`SequenceType.SEQUENCE` means the sample is a sequence.
- :code:`SequenceType.SUB_SEQUENCE` means the sample is a nested sequence,
each timestep of which is also a sequence.
Accordingly, AggregateLevel supports two modes:
- :code:`AggregateLevel.EACH_TIMESTEP` means the aggregation acts on each
timestep of a sequence, both :code:`SUB_SEQUENCE` and :code:`SEQUENCE` will
be aggregated to :code:`NO_SEQUENCE`.
- :code:`AggregateLevel.EACH_SEQUENCE` means the aggregation acts on each
sequence of a nested sequence, :code:`SUB_SEQUENCE` will be aggregated to
:code:`SEQUENCE`.
"""
EACH_TIMESTEP = 'non-seq' EACH_TIMESTEP = 'non-seq'
EACH_SEQUENCE = 'seq' EACH_SEQUENCE = 'seq'
...@@ -1454,6 +1472,19 @@ def first_seq(input, ...@@ -1454,6 +1472,19 @@ def first_seq(input,
class ExpandLevel(object): class ExpandLevel(object):
"""
Please refer to AggregateLevel first.
ExpandLevel supports two modes:
- :code:`ExpandLevel.FROM_TIMESTEP` means the expandation acts on each
timestep of a sequence, :code:`NO_SEQUENCE` will be expanded to
:code:`SEQUENCE` or :code:`SUB_SEQUENCE`.
- :code:`ExpandLevel.FROM_SEQUENCE` means the expandation acts on each
sequence of a nested sequence, :code:`SEQUENCE` will be expanded to
:code:`SUB_SEQUENCE`.
"""
FROM_TIMESTEP = AggregateLevel.EACH_TIMESTEP FROM_TIMESTEP = AggregateLevel.EACH_TIMESTEP
FROM_SEQUENCE = AggregateLevel.EACH_SEQUENCE FROM_SEQUENCE = AggregateLevel.EACH_SEQUENCE
......
...@@ -404,8 +404,8 @@ class RecurrentLayerOutput(Layer): ...@@ -404,8 +404,8 @@ class RecurrentLayerOutput(Layer):
LayerV2 = Layer LayerV2 = Layer
data = DataLayerV2 data = DataLayerV2
data.__name__ = 'data' data.__name__ = 'data'
AggregateLevel = conf_helps.layers.AggregateLevel AggregateLevel = conf_helps.AggregateLevel
ExpandLevel = conf_helps.layers.ExpandLevel ExpandLevel = conf_helps.ExpandLevel
memory = MemoryV2 memory = MemoryV2
memory.__name__ = 'memory' memory.__name__ = 'memory'
memory.__doc__ = conf_helps.memory.__doc__ memory.__doc__ = conf_helps.memory.__doc__
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册