Question

A partir du code tensorflow: tensorflow. RnnCell.

num_units: int, The number of units in the LSTM cell.

ne peut pas undestand ce que cela signifie. Quelles sont les unités de cellules LSTM. Entrée, sortie et portes? Oublieront Est-ce que cela signifie « nombre d'unités dans la couche de projection récurrente pour Deep LSTM ». Alors pourquoi on l'appelle « nombre d'unités dans la cellule LSTM »? Qu'est-ce que la cellule de LSTM et quelle est la différence bloc VS LSTM, ce qui est l'unité de LSTM minimale sinon cellule?

Était-ce utile?

La solution

As the helpful comments in that function say,

The definition of cell in this package differs from the definition used in the literature. In the literature, cell refers to an object with a single scalar output. The definition in this package refers to a horizontal array of such units.

In essence, the layer will contain multiple parallel LSTM units, structurally identical but each eventually "learning to remember" some different thing.

Autres conseils

Most LSTM/RNN diagrams just show the hidden cells but never the units of those cells. Hence, the confusion. Each hidden layer has hidden cells, as many as the number of time steps. And further, each hidden cell is made up of multiple hidden units, like in the diagram below. Therefore, the dimensionality of a hidden layer matrix in RNN is (number of time steps, number of hidden units).

enter image description here

In Keras, which sits on top of either TensorFlow or Theano, when you call model.add(LSTM(num_units)), num_units is the dimensionality of the output space (from here, line 863). To me, that means num_units is the number of hidden units whose activations get sent forward to the next time step.

Licencié sous: CC-BY-SA avec attribution
scroll top