Support lstm and lstmCell operations#227
Support lstm and lstmCell operations#227BruceDai wants to merge 3 commits intowebmachinelearning:masterfrom
Conversation
| 5.51000023, 20.01000214, | ||
| 19.11000061, 75.20999908, | ||
| ], | ||
| [ |
There was a problem hiding this comment.
@fdwr This third result containing every output from each time step
[
1, 8,
1, 8,
10.46900082, 58.02900696,
74.52900696, 518.94897461,
],
is different from the result "Y" of ONNX conformance tests in order, any suggestions? Thanks.
"Y": {
"type": "float32",
"dims": [2, 1, 2, 2],
"value": [[[[10.469000816345215, 58.02900695800781], [74.52900695800781, 518.948974609375]]], [[[1, 8], [1, 8]]]]
},
There was a problem hiding this comment.
Does this pass now, after the changes, or is it still an issue?
There was a problem hiding this comment.
It's still an issue.
88e163a to
425f377
Compare
src/nn/ops/lstm.ts
Outdated
| const starts = layout === MLLstmWeightLayout.iofg ? | ||
| {i: 0, o: hiddenSize, f: 2 * hiddenSize, g: 3 * hiddenSize} : | ||
| /*ifog*/ {i: 0, f: hiddenSize, o: 2 * hiddenSize, g: 3 * hiddenSize}; | ||
| /*ifgo*/ {i: 0, f: hiddenSize, g: 2 * hiddenSize, 0: 3 * hiddenSize}; |
There was a problem hiding this comment.
What does 0: mean? I didn't know that key names were even allowed to start with digits :b (I figured they followed the same rules as other identifiers where they may contain digits but must start with a letter).
There was a problem hiding this comment.
What does 0: mean?
It's a typo error, I've fixed it with last commit.
There was a problem hiding this comment.
I wondered if 0: should have been O: :b. Otherwise the rest looks fine, but mind you, I believe you understand LSTM better than I do after you finished reading that paper. So I'll have to somewhat trust that it's correct by vetting consistency with the other conformance tests.
This pr is to
@fdwr @huningxin @Honry PTAL, thanks.