parameters: (self,
                 units,
                 memory,
                 memory_sequence_length=None,
                 normalize=False,
                 sigmoid_noise=0.,
                 sigmoid_noise_seed=None,
                 score_bias_init=0.,
                 mode="parallel",
                 kernel_initializer="glorot_uniform",
                 dtype=None,
                 name="BahdanauMonotonicAttention",
                 **kwargs)
docstring: Construct the Attention mechanism.
  
      Args:
        units: The depth of the query mechanism.
        memory: The memory to query; usually the output of an RNN encoder.  This
          tensor should be shaped `[batch_size, max_time, ...]`.
        memory_sequence_length: (optional): Sequence lengths for the batch entries
          in memory.  If provided, the memory tensor rows are masked with zeros
          for values past the respective sequence lengths.
        normalize: Python boolean. Whether to normalize the energy term.
        sigmoid_noise: Standard deviation of pre-sigmoid noise. See the docstring
          for `_monotonic_probability_fn` for more information.
        sigmoid_noise_seed: (optional) Random seed for pre-sigmoid noise.
        score_bias_init: Initial value for score bias scalar. It's recommended to
          initialize this to a negative value when the length of the memory is
          large.
        mode: How to compute the attention distribution. Must be one of
          'recursive', 'parallel', or 'hard'. See the docstring for
          `tf.contrib.seq2seq.monotonic_attention` for more information.
        kernel_initializer: (optional), the name of the initializer for the
          attention kernel.
        dtype: The data type for the query and memory layers of the attention
          mechanism.
        name: Name to use when creating ops.
        **kwargs: Dictionary that contains other common arguments for layer
          creation.
docstring_summary: Construct the Attention mechanism.
docstring_tokens: Construct the Attention mechanism .
function: def __init__(self,
                 units,
                 memory,
                 memory_sequence_length=None,
                 normalize=False,
                 sigmoid_noise=0.,
                 sigmoid_noise_seed=None,
                 score_bias_init=0.,
                 mode="parallel",
                 kernel_initializer="glorot_uniform",
                 dtype=None,
                 name="BahdanauMonotonicAttention",
                 **kwargs):
      """Construct the Attention mechanism.
  
      Args:
        units: The depth of the query mechanism.
        memory: The memory to query; usually the output of an RNN encoder.  This
          tensor should be shaped `[batch_size, max_time, ...]`.
        memory_sequence_length: (optional): Sequence lengths for the batch entries
          in memory.  If provided, the memory tensor rows are masked with zeros
          for values past the respective sequence lengths.
        normalize: Python boolean. Whether to normalize the energy term.
        sigmoid_noise: Standard deviation of pre-sigmoid noise. See the docstring
          for `_monotonic_probability_fn` for more information.
        sigmoid_noise_seed: (optional) Random seed for pre-sigmoid noise.
        score_bias_init: Initial value for score bias scalar. It's recommended to
          initialize this to a negative value when the length of the memory is
          large.
        mode: How to compute the attention distribution. Must be one of
          'recursive', 'parallel', or 'hard'. See the docstring for
          `tf.contrib.seq2seq.monotonic_attention` for more information.
        kernel_initializer: (optional), the name of the initializer for the
          attention kernel.
        dtype: The data type for the query and memory layers of the attention
          mechanism.
        name: Name to use when creating ops.
        **kwargs: Dictionary that contains other common arguments for layer
          creation.
      """
      # Set up the monotonic probability fn with supplied parameters
      if dtype is None:
        dtype = dtypes.float32
      wrapped_probability_fn = functools.partial(
          _monotonic_probability_fn,
          sigmoid_noise=sigmoid_noise,
          mode=mode,
          seed=sigmoid_noise_seed)
      query_layer = kwargs.pop("query_layer", None)
      if not query_layer:
        query_layer = layers.Dense(
            units, name="query_layer", use_bias=False, dtype=dtype)
      memory_layer = kwargs.pop("memory_layer", None)
      if not memory_layer:
        memory_layer = layers.Dense(
            units, name="memory_layer", use_bias=False, dtype=dtype)
      self.units = units
      self.normalize = normalize
      self.sigmoid_noise = sigmoid_noise
      self.sigmoid_noise_seed = sigmoid_noise_seed
      self.score_bias_init = score_bias_init
      self.mode = mode
      self.kernel_initializer = initializers.get(kernel_initializer)
      self.attention_v = None
      self.attention_score_bias = None
      self.attention_g = None
      self.attention_b = None
      super(BahdanauMonotonicAttentionV2, self).__init__(
          memory=memory,
          memory_sequence_length=memory_sequence_length,
          query_layer=query_layer,
          memory_layer=memory_layer,
          probability_fn=wrapped_probability_fn,
          name=name,
          dtype=dtype,
          **kwargs)
function_tokens: def __init__ ( self , units , memory , memory_sequence_length = None , normalize = False , sigmoid_noise = 0. , sigmoid_noise_seed = None , score_bias_init = 0. , mode = "parallel" , kernel_initializer = "glorot_uniform" , dtype = None , name = "BahdanauMonotonicAttention" , * * kwargs ) : # Set up the monotonic probability fn with supplied parameters if dtype is None : dtype = dtypes . float32 wrapped_probability_fn = functools . partial ( _monotonic_probability_fn , sigmoid_noise = sigmoid_noise , mode = mode , seed = sigmoid_noise_seed ) query_layer = kwargs . pop ( "query_layer" , None ) if not query_layer : query_layer = layers . Dense ( units , name = "query_layer" , use_bias = False , dtype = dtype ) memory_layer = kwargs . pop ( "memory_layer" , None ) if not memory_layer : memory_layer = layers . Dense ( units , name = "memory_layer" , use_bias = False , dtype = dtype ) self . units = units self . normalize = normalize self . sigmoid_noise = sigmoid_noise self . sigmoid_noise_seed = sigmoid_noise_seed self . score_bias_init = score_bias_init self . mode = mode self . kernel_initializer = initializers . get ( kernel_initializer ) self . attention_v = None self . attention_score_bias = None self . attention_g = None self . attention_b = None super ( BahdanauMonotonicAttentionV2 , self ) . __init__ ( memory = memory , memory_sequence_length = memory_sequence_length , query_layer = query_layer , memory_layer = memory_layer , probability_fn = wrapped_probability_fn , name = name , dtype = dtype , * * kwargs )