Skip to content

Conversation

@larissakl
Copy link
Contributor

The function finalizeScoringContext() is added to the LabelScorer. The StatefulOnnxLabelScorer won't update the hidden state in extendedScoringContext() anymore, but only append the new token to the sequence. The hidden state update is now done in this new function. The default implementation which is used in the other label scorers is just no-op. For future label scorers, one should pay attention to put costly operations which don't affect the hash into finalizeScoringContext() instead of extendedScoringContext() if possible.
In the search algorithms, the order is now:

  1. Score Pruning
  2. Extended Scoring Context
  3. Recombination
  4. Beam Size Pruning
  5. Finalize Scoring Context

The last step is not done at the end of the decode step, but at the beginning of the next decode step such that we save unnecessary calculations at the end of a segment.

@SimBe195
Copy link
Collaborator

I believe in our regular RASR meeting we decided to do this a bit differently and keep the logic only internally in the StatefulLabelScorer instead of modifying the interface or search algorithms directly. I can do the re-write on this branch accordingly but until then, the PR shouldn't be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants