word-rnn-tensorflow
word-rnn-tensorflow copied to clipboard
Beam search?
Currently, we are using weighted_pick to select outputs:
def weighted_pick(weights):
t = np.cumsum(weights)
s = np.sum(weights)
return(int(np.searchsorted(t, np.random.rand(1)*s)))
Should we also add beam search as an option?
See beam search implementations in Tensorflow https://github.com/tensorflow/tensorflow/issues/654!
Can you please explain why cumulative sum is used here ?