TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfa.seq2seq.beam_search_decoder.attention_probs_from_attn_state

View source on GitHub

Calculates the average attention probabilities.

tfa.seq2seq.beam_search_decoder.attention_probs_from_attn_state(attention_state)

Args:

  • attention_state: An instance of AttentionWrapperState.

Returns:

The attention probabilities in the given AttentionWrapperState. If there're multiple attention mechanisms, return the average value from all attention mechanisms.