Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for _ in range(100):
- ix = torch.tensor([[choice]]).to(device)
- output, (state_h, state_c) = net(ix, (state_h, state_c))
- _, top_ix = torch.topk(output[0], k=top_k)
- choices = top_ix.tolist()
- choice = np.random.choice(choices[0])
- words.append(int_to_vocab[choice])
- print(' '.join(words))
Add Comment
Please, Sign In to add comment