mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Not all LSTM layout options are specified

Open SumNeuron opened this issue 9 years ago • 2 comments

In the docs for the LSTM layer it states that one can specify the layout with the following options:

  • T = Sequence Length
  • N = Batch Size
  • C = Feature Dimensions

and the default is TNC.

The other accepted format is NTC (batch x seq x feat).

This is an issue for two reasons:

  1. it is not stated in the auto-generated docs. Mostly this is because of the hard-coded assert statement:
assert layout == 'TNC' or layout == 'NTC', \
             "Invalid layout %s; must be one of ['TNC' or 'NTC']"%layout

which is why this is not being picked up by the auto-doc generation. However this should be there.

  1. because there are 3! ways for a user to order the characters 'T', 'N', and 'C':
  • TNC (seq x batch x feat)
  • TCN (seq x batch x feat)
  • NTC (batch x seq x feat)
  • NCT (batch x feat x seq)
  • CNT (feat x batch x seq)
  • CTN (feat x seq x batch)

While some of these formats are more likely to be used than others, I would at least expect NCT to be implemented, as it parallels 1D time series (batch, channels, values over time).

In short, I would say for maximum utility that all implementations should be implemented, however I would like to place priority on NTC.

Also maybe add a drop-down element to the docs to show assertions (so viable options are known)

SumNeuron avatar Nov 24 '17 10:11 SumNeuron

proposed labels: "Feature request", "Doc"

zhiz21 avatar Mar 10 '18 00:03 zhiz21

The assertion error message gives the current possible valid layouts so not really a doc issue. If the 'NTC' layout feature or other layout is implemented then doc will be updated alongside.

sojiadeshina avatar Jan 23 '19 23:01 sojiadeshina