Skip to content

Commit

Permalink
inferencing with top k 2
Browse files Browse the repository at this point in the history
  • Loading branch information
zsdonghao committed Sep 6, 2017
1 parent 3c9837a commit d8375cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Query > donald trump won last nights presidential debate according to snap onlin
> i think he was a racist
> he is not a racist
> he is a liar
> i dont think he is a disgrace
> trump needs to be president
```
<!---
Expand Down
2 changes: 1 addition & 1 deletion main_simple_seq2seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def model(encode_seqs, decode_seqs, is_train=True, reuse=False):
o, state = sess.run([y, net_rnn.final_state_decode],
{net_rnn.initial_state_decode: state,
decode_seqs2: [[w_id]]})
w_id = tl.nlp.sample_top(o[0], top_k=3)
w_id = tl.nlp.sample_top(o[0], top_k=2)
w = idx2w[w_id]
if w_id == end_id:
break
Expand Down

0 comments on commit d8375cb

Please sign in to comment.