|
def | __init__ (self, beam_size, model, eos_token_id, go_token_id=seq2seq_util.GO_ID, post_eos_penalty=None) |
|
def | get_step_model (self) |
|
def | get_previous_tokens (self) |
|
def | get_timestep (self) |
|
def | apply (self, inputs, length, log_probs, attentions, state_configs, data_dependencies, word_rewards=None, possible_translation_tokens=None, go_token_id=None) |
|
Class generalizing forward beam search for seq2seq models.
Also provides types to specify the recurrent structure of decoding:
StateConfig:
initial_value: blob providing value of state at first step_model
state_prev_link: LinkConfig describing how recurrent step receives
input from global state blob in each step
state_link: LinkConfig describing how step writes (produces new state)
to global state blob in each step
LinkConfig:
blob: blob connecting global state blob to step application
offset: offset from beginning of global blob for link in time dimension
window: width of global blob to read/write in time dimension
Definition at line 14 of file beam_search.py.