Skip to content

There is no doc about why PaddlePaddle has so many interfaces that looks very similar but essentially different #2020

Closed
@lcy-seso

Description

@lcy-seso

I find PaddlePaddle has various kinds of RNN unit, take lstm for example, we have:

  • lstmemory in python/paddle/trainer_config_helpers/layers.py

  • simple_lstm in python/paddle/trainer_config_helpers/networks.py

  • lstmemory_unit in python/paddle/trainer_config_helpers/networks.py

  • lstmemory_group in python/paddle/trainer_config_helpers/networks.py

  • bidirectional_lstm in python/paddle/trainer_config_helpers/networks.py (This is relatively easy to understand)

  • For GRU, we even have simple_gru and simple_gru2 (The name simple_gru2 is terrible and confusing).

These interfaces look extremely similar from their names, but they work differently and should be chosen in different situations. Even though there are some explanations spread in the source codes, but they are hard to follow. If I were a beginner to PaddlePaddle, I would definitely be confusing to choose which one to use.

I suggest we create some documents organized by useful topics to explain such a confusing situation.

Besides, some design idea is not consistent or just missing.

  • For example, In PaddlePaddle, a fully connected layer and a lstmemory together is a lstm unit as we are familiar to in the textbook, which is also the situation for some other layers, for example, the CRF layer.
  • We provide simple_lstm to encapsulate a fully connected layer and a lstmmeory layer, following the same idea, why do we not provide such an encapsulation for CRF layer? Such an encapsulation for simple RNN is also missing.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions