(initializer=consts.NORMAL_INIT, stddev=0.02)
Returns the initializer for the given name.

  Args:
    initializer: Name of the initalizer. Use one in consts.INITIALIZERS.
    stddev: Standard deviation passed to initalizer.

  Returns:
    Initializer from `tf.initializers`.
Returns the initializer for the given name.
Returns the initializer for the given name .
def weight_initializer(initializer=consts.NORMAL_INIT, stddev=0.02):
  """Returns the initializer for the given name.

  Args:
    initializer: Name of the initalizer. Use one in consts.INITIALIZERS.
    stddev: Standard deviation passed to initalizer.

  Returns:
    Initializer from `tf.initializers`.
  """
  if initializer == consts.NORMAL_INIT:
    return tf.initializers.random_normal(stddev=stddev)
  if initializer == consts.TRUNCATED_INIT:
    return tf.initializers.truncated_normal(stddev=stddev)
  if initializer == consts.ORTHOGONAL_INIT:
    return tf.initializers.orthogonal()
  raise ValueError("Unknown weight initializer {}.".format(initializer))
def weight_initializer ( initializer = consts . NORMAL_INIT , stddev = 0.02 ) : if initializer == consts . NORMAL_INIT : return tf . initializers . random_normal ( stddev = stddev ) if initializer == consts . TRUNCATED_INIT : return tf . initializers . truncated_normal ( stddev = stddev ) if initializer == consts . ORTHOGONAL_INIT : return tf . initializers . orthogonal ( ) raise ValueError ( "Unknown weight initializer {}." . format ( initializer ) )