fhieber opened a new pull request #8027: Optional reshape of predictions in Perplexity metric URL: https://github.com/apache/incubator-mxnet/pull/8027 Fixes a shape issue with the Perplexity metric after #7949 and #8003 were merged: after these PRs, the executor_group slices graph outputs according to the size of the batch axis. This forces graph/symbol outputs to be batch-major if used to compute metrics. In cases like Sockeye, we used to feed label as (batch_size, length) into the graph, but return (batch_size*length, vocab_size) as output after SoftmaxOutput. This is also the required format for the Perplexity metric. With the PRs mentioned above, this now fails, as the executor_group slices the `(batch_size*length, vocab_size)` output to `(batch_size, vocab_size)`, which is obviously wrong. We can fix this by using `preserve_shape=True` in our SoftmaxOutput call and return `(batch_size*length, vocab_size)` outputs. However, this caused the Perplexity metric to fail. This PR fixes this by doing an optional reshape of the predictions to 2d. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
With regards, Apache Git Services
