提交 fe321650 编写于 作者: L luotao02

catalog for trainer_config_helpers

ISSUE=4584581 

git-svn-id: https://svn.baidu.com/idl/trunk/paddle@1413 1ad973e4-5ce8-4261-8a94-b56d1f490c56
上级 4b7b99be
...@@ -9,5 +9,6 @@ User Guide ...@@ -9,5 +9,6 @@ User Guide
* [User Interface](ui/index.md) * [User Interface](ui/index.md)
* [Source Code Documents](source/index.md) * [Source Code Documents](source/index.md)
* [Layer Documents](layer.md) * [Layer Documents](layer.md)
* [Trainer Config Helpers](ui/api/trainer_config_helpers/index.md)
* [Example and Demo](demo/index.md) * [Example and Demo](demo/index.md)
* [Cluster Train](cluster/index.md) * [Cluster Train](cluster/index.md)
...@@ -47,7 +47,3 @@ ...@@ -47,7 +47,3 @@
- [Lock](utils/lock.rst) - [Lock](utils/lock.rst)
- [Queue](utils/queue.rst) - [Queue](utils/queue.rst)
- [Thread](utils/thread.rst) - [Thread](utils/thread.rst)
## proto
TBD
Activations BaseActivation
=========== ==============
.. automodule:: paddle.trainer_config_helpers.activations .. automodule:: paddle.trainer_config_helpers.activations
:members: :members: BaseActivation
:noindex:
AbsActivation
===============
.. automodule:: paddle.trainer_config_helpers.activations
:members: AbsActivation
:noindex:
IdentityActivation
==================
.. automodule:: paddle.trainer_config_helpers.activations
:members: IdentityActivation
:noindex:
LinearActivation
==================
.. automodule:: paddle.trainer_config_helpers.activations
:members: LinearActivation
:noindex:
SquareActivation
================
.. automodule:: paddle.trainer_config_helpers.activations
:members: SquareActivation
:noindex:
SigmoidActivation
=================
.. automodule:: paddle.trainer_config_helpers.activations
:members: SigmoidActivation
:noindex:
SoftmaxActivation
=================
.. automodule:: paddle.trainer_config_helpers.activations
:members: SoftmaxActivation
:noindex:
SequenceSoftmaxActivation
=========================
.. automodule:: paddle.trainer_config_helpers.activations
:members: SequenceSoftmax
:noindex:
ReluActivation
==============
.. automodule:: paddle.trainer_config_helpers.activations
:members: ReluActivation
:noindex:
BReluActivation
===============
.. automodule:: paddle.trainer_config_helpers.activations
:members: BReluActivation
:noindex:
SoftReluActivation
==================
.. automodule:: paddle.trainer_config_helpers.activations
:members: SoftReluActivation
:noindex:
TanhActivation
==============
.. automodule:: paddle.trainer_config_helpers.activations
:members: TanhActivation
:noindex:
STanhActivation
===============
.. automodule:: paddle.trainer_config_helpers.activations
:members: STanhActivation
:noindex:
Evaluators Base
========== ====
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: evaluator_base
:noindex:
Classification
==============
classification_error_evaluator
------------------------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: classification_error_evaluator
:noindex:
auc_evaluator
-------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: auc_evaluator
:noindex:
ctc_error_evaluator
-------------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: ctc_error_evaluator
:noindex:
chunk_evaluator
---------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: chunk_evaluator
:noindex:
precision_recall_evaluator
--------------------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: precision_recall_evaluator
:noindex:
Rank
====
pnpair_evaluator
----------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: pnpair_evaluator
:noindex:
Utils
=====
sum_evaluator
-------------
.. automodule:: paddle.trainer_config_helpers.evaluators .. automodule:: paddle.trainer_config_helpers.evaluators
:members: :members: sum_evaluator
:noindex:
column_sum_evaluator
--------------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: column_sum_evaluator
:noindex:
Print
=====
classification_error_printer_evaluator
--------------------------------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: classification_error_printer_evaluator
:noindex:
gradient_printer_evaluator
--------------------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: gradient_printer_evaluator
:noindex:
maxid_printer_evaluator
-----------------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: maxid_printer_evaluator
:noindex:
maxframe_printer_evaluator
---------------------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: maxframe_printer_evaluator
:noindex:
seqtext_printer_evaluator
-------------------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: seqtext_printer_evaluator
:noindex:
value_printer_evaluator
-----------------------
.. automodule:: paddle.trainer_config_helpers.evaluators
:members: value_printer_evaluator
:noindex:
Evaluators
==========
.. toctree::
:maxdepth: 3
evaluators.rst
# Trainer Config Helpers # Trainer Config Helpers
* [Optimizer](optimizers.rst) * [Optimizer](optimizers_index.rst)
* [Data Source](data_sources.rst) * [Data Source](data_sources.rst)
* [Layers](layers_index.rst) * [Layers](layers_index.rst)
* [Activations](activations.rst) * [Activations](activations_index.rst)
* [Poolings](poolings.rst) * [Poolings](poolings_index.rst)
* [Networks](networks.rst) * [Networks](networks_index.rst)
* [Evaluators](evaluators.rst) * [Evaluators](evaluators_index.rst)
* [Parameter and Extra Layer Attribute](attrs.rst) * [Parameter and Extra Layer Attribute](attrs.rst)
Networks NLP
======== ===
sequence_conv_pool
------------------
.. automodule:: paddle.trainer_config_helpers.networks .. automodule:: paddle.trainer_config_helpers.networks
:members: :members: sequence_conv_pool
:noindex:
text_conv_pool
--------------
.. automodule:: paddle.trainer_config_helpers.networks
:members: text_conv_pool
:noindex:
Images
======
img_conv_bn_pool
----------------
.. automodule:: paddle.trainer_config_helpers.networks
:members: img_conv_bn_pool
:noindex:
img_conv_group
--------------
.. automodule:: paddle.trainer_config_helpers.networks
:members: img_conv_group
:noindex:
simple_img_conv_pool
--------------------
.. automodule:: paddle.trainer_config_helpers.networks
:members: simple_img_conv_pool
:noindex:
vgg_16_network
---------------
.. automodule:: paddle.trainer_config_helpers.networks
:members: vgg_16_network
:noindex:
Recurrent
=========
lstmemory_unit
--------------
.. automodule:: paddle.trainer_config_helpers.networks
:members: lstmemory_unit
:noindex:
lstmemory_group
---------------
.. automodule:: paddle.trainer_config_helpers.networks
:members: lstmemory_group
:noindex:
gru_unit
---------
.. automodule:: paddle.trainer_config_helpers.networks
:members: gru_unit
:noindex:
simple_lstm
-----------
.. automodule:: paddle.trainer_config_helpers.networks
:members: simple_lstm
:noindex:
bidirectional_lstm
------------------
.. automodule:: paddle.trainer_config_helpers.networks
:members: bidirectional_lstm
:noindex:
simple_attention
----------------
.. automodule:: paddle.trainer_config_helpers.networks
:members: simple_attention
:noindex:
Miscs
=====
dropout_layer
--------------
.. automodule:: paddle.trainer_config_helpers.networks
:members: dropout_layer
:noindex:
outputs
-------
.. automodule:: paddle.trainer_config_helpers.networks
:members: outputs
:noindex:
Networks
========
The networks module contains pieces of neural network that combine multiple layers.
.. toctree::
:maxdepth: 3
networks.rst
Optimizers BaseSGDOptimizer
========== ================
.. automodule:: paddle.trainer_config_helpers.optimizers
:members: BaseSGDOptimizer
:noindex:
AdamOptimizer
=============
.. automodule:: paddle.trainer_config_helpers.optimizers
:members: AdamOptimizer
:noindex:
AdamxOptimizer
================
.. automodule:: paddle.trainer_config_helpers.optimizers
:members: AdamxOptimizer
:noindex:
AdaGradOptimizer
================
.. automodule:: paddle.trainer_config_helpers.optimizers
:members: AdaGradOptimizer
:noindex:
DecayedAdaGradOptimizer
=======================
.. automodule:: paddle.trainer_config_helpers.optimizers .. automodule:: paddle.trainer_config_helpers.optimizers
:members: :members: DecayedAdaGradOptimizer
:noindex:
AdaDeltaOptimizer
=================
.. automodule:: paddle.trainer_config_helpers.optimizers
:members: AdaDeltaOptimizer
:noindex:
RMSPropOptimizer
================
.. automodule:: paddle.trainer_config_helpers.optimizers
:members: RMSPropOptimizer
:noindex:
settings
========
.. automodule:: paddle.trainer_config_helpers.optimizers
:members: settings
:noindex:
Optimizers
==========
.. toctree::
:maxdepth: 3
optimizers.rst
Poolings BasePoolingType
======== ===============
.. automodule:: paddle.trainer_config_helpers.poolings
:members: BasePoolingType
:noindex:
AvgPooling
==========
.. automodule:: paddle.trainer_config_helpers.poolings
:members: AvgPooling
:noindex:
MaxPooling
==========
.. automodule:: paddle.trainer_config_helpers.poolings
:members: MaxPooling
:noindex:
SumPooling
==========
.. automodule:: paddle.trainer_config_helpers.poolings
:members: SumPooling
:noindex:
SquareRootNPooling
==================
.. automodule:: paddle.trainer_config_helpers.poolings .. automodule:: paddle.trainer_config_helpers.poolings
:members: :members: SquareRootNPooling
:noindex:
Poolings
========
These pooling types are used for sequence input, not for images.
.. toctree::
:maxdepth: 3
poolings.rst
...@@ -12,16 +12,6 @@ ...@@ -12,16 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
"""
Paddle Supported Activations.
Each activation inherit BaseActivation, which has two attributes.
- name: activation name in paddle config.
- support_hppl: True if supported by hppl. lstm layer can only use activations
supported by hppl (the name hppl will be revised later).
"""
__all__ = ["TanhActivation", "SigmoidActivation", __all__ = ["TanhActivation", "SigmoidActivation",
"SoftmaxActivation", "IdentityActivation", "LinearActivation", "SoftmaxActivation", "IdentityActivation", "LinearActivation",
'SequenceSoftmaxActivation', 'SequenceSoftmaxActivation',
...@@ -31,7 +21,15 @@ __all__ = ["TanhActivation", "SigmoidActivation", ...@@ -31,7 +21,15 @@ __all__ = ["TanhActivation", "SigmoidActivation",
class BaseActivation(object): class BaseActivation(object):
""" """
A mark for activation class. A mark for activation class.
Each activation inherit BaseActivation, which has two parameters.
:param name: activation name in paddle config.
:type name: basestring
:param support_hppl: True if supported by hppl. HPPL is a library used by paddle
internally. Currently, lstm layer can only use activations
supported by hppl.
:type support_hppl: bool
""" """
def __init__(self, name, support_hppl): def __init__(self, name, support_hppl):
......
...@@ -12,35 +12,10 @@ ...@@ -12,35 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
"""
Evaluator will evaluate the network status while training/testing.
User can use evaluator by classify/regression job. For example.
.. code-block:: python
classify(prediction, output, evaluator=classification_error_evaluator)
And user could define evaluator separately as follow.
.. code-block:: python
classification_error_evaluator("ErrorRate", prediction, label)
The evaluator often contains a name parameter. It will also be printed when
evaluating network. The printed information may look like the following.
.. code-block:: text
Batch=200 samples=20000 AvgCost=0.679655 CurrentCost=0.662179 Eval:
classification_error_evaluator=0.4486
CurrentEval: ErrorRate=0.3964
"""
from paddle.trainer.config_parser import * from paddle.trainer.config_parser import *
from default_decorators import * from default_decorators import *
__all__ = ["classification_error_evaluator", "auc_evaluator", __all__ = ["evaluator_base","classification_error_evaluator", "auc_evaluator",
"pnpair_evaluator", "precision_recall_evaluator", "pnpair_evaluator", "precision_recall_evaluator",
"ctc_error_evaluator", "chunk_evaluator", "sum_evaluator", "ctc_error_evaluator", "chunk_evaluator", "sum_evaluator",
"column_sum_evaluator", "value_printer_evaluator", "column_sum_evaluator", "value_printer_evaluator",
...@@ -97,6 +72,29 @@ def evaluator_base( ...@@ -97,6 +72,29 @@ def evaluator_base(
num_results=1, num_results=1,
delimited=True): delimited=True):
""" """
Evaluator will evaluate the network status while training/testing.
User can use evaluator by classify/regression job. For example.
.. code-block:: python
classify(prediction, output, evaluator=classification_error_evaluator)
And user could define evaluator separately as follow.
.. code-block:: python
classification_error_evaluator("ErrorRate", prediction, label)
The evaluator often contains a name parameter. It will also be printed when
evaluating network. The printed information may look like the following.
.. code-block:: text
Batch=200 samples=20000 AvgCost=0.679655 CurrentCost=0.662179 Eval:
classification_error_evaluator=0.4486
CurrentEval: ErrorRate=0.3964
:param input: Input layers, a object of LayerOutput or a list of :param input: Input layers, a object of LayerOutput or a list of
LayerOutput. LayerOutput.
:type input: list|LayerOutput :type input: list|LayerOutput
......
...@@ -13,27 +13,6 @@ ...@@ -13,27 +13,6 @@
# limitations under the License. # limitations under the License.
""" """
The networks module contains pieces of neural network that combine multiple
layers.
The pieces are:
- NLP
* Text Convolution component
- Images
* Conv_Pool
* Conv_BatchNorm_Pool
- Recurrent
* simple_lstm
- Miscs
* dropout_layer
""" """
# from activations import * # from activations import *
......
...@@ -13,12 +13,6 @@ ...@@ -13,12 +13,6 @@
# limitations under the License. # limitations under the License.
""" """
Pooling type that paddle supported. Note these pooling types are used for
sequence input, not for images.
Each PoolingType contains.
- name: pooling layer type name used by paddle.
""" """
__all__ = [ __all__ = [
...@@ -32,7 +26,13 @@ __all__ = [ ...@@ -32,7 +26,13 @@ __all__ = [
class BasePoolingType(object): class BasePoolingType(object):
""" """
Base Pooling Type. Base Pooling Type.
Note these pooling types are used for sequence input, not for images.
Each PoolingType contains one parameter:
:param name: pooling layer type name used by paddle.
:type name: basestring
""" """
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册