Skip to content

Commit

Permalink
Refactor beam search to use gluon hybrid blocks (#425)
Browse files Browse the repository at this point in the history
This refactors beam search to group fixed-size operations in beam search into cached ops through Gluon HybridBlocks.
My testing showed ~3% speed improvement. Not much, but consistent.

Another change that is included here is to not use columns from `sequences` to pass into the decoder step module, but use `best_word_indices` from the previous iteration. NDArray indexing seems expensive and ideally we should aim for avoiding all indexing ops in an iteration.
  • Loading branch information
fhieber authored Jun 4, 2018
1 parent 30a58fe commit f56e783
Show file tree
Hide file tree
Showing 4 changed files with 252 additions and 118 deletions.
Loading

0 comments on commit f56e783

Please sign in to comment.