bert_max_doc_str_max_str_pos_clean_doc_noise_doc/run_doc_qa.py
def _build_initializer(initializer):
    """Builds initialization method for the TF model."""
    if initializer == 'Uniform':
        tf.logging.info('Using random_uniform_initializer')
        tf_initializer = tf.random_uniform_initializer(
            -0.1, 0.1, dtype=tf.float32
        )
    elif initializer == 'Gaussian':
        tf.logging.info('Using truncated_normal_initializer')
        tf_initializer = tf.truncated_normal_initializer(
            stddev=0.1, dtype=tf.float32
        )
    elif initializer == 'Xavier':
        tf.logging.info('Using xavier_initializer')
        tf_initializer = tf.contrib.layers.variance_scaling_initializer(
            factor=2.0, mode='FAN_IN', uniform=False, dtype=tf.float32
        )
    else:
        raise ValueError('Unknown initializer {0}!'.format(initializer))

    return tf_initializer
Builds initialization method for the TF model.
Builds initialization method for the TF model.
Builds initialization method for the TF model .
def _build_initializer(initializer):
    if initializer == 'Uniform':
        tf.logging.info('Using random_uniform_initializer')
        tf_initializer = tf.random_uniform_initializer(
            -0.1, 0.1, dtype=tf.float32
        )
    elif initializer == 'Gaussian':
        tf.logging.info('Using truncated_normal_initializer')
        tf_initializer = tf.truncated_normal_initializer(
            stddev=0.1, dtype=tf.float32
        )
    elif initializer == 'Xavier':
        tf.logging.info('Using xavier_initializer')
        tf_initializer = tf.contrib.layers.variance_scaling_initializer(
            factor=2.0, mode='FAN_IN', uniform=False, dtype=tf.float32
        )
    else:
        raise ValueError('Unknown initializer {0}!'.format(initializer))
    return tf_initializer
def _build_initializer ( initializer ) : if initializer == 'Uniform' : tf . logging . info ( 'Using random_uniform_initializer' ) tf_initializer = tf . random_uniform_initializer ( - 0.1 , 0.1 , dtype = tf . float32 ) elif initializer == 'Gaussian' : tf . logging . info ( 'Using truncated_normal_initializer' ) tf_initializer = tf . truncated_normal_initializer ( stddev = 0.1 , dtype = tf . float32 ) elif initializer == 'Xavier' : tf . logging . info ( 'Using xavier_initializer' ) tf_initializer = tf . contrib . layers . variance_scaling_initializer ( factor = 2.0 , mode = 'FAN_IN' , uniform = False , dtype = tf . float32 ) else : raise ValueError ( 'Unknown initializer {0}!' . format ( initializer ) ) return tf_initializer
Builds initialization method for the TF model.
Builds initialization method for the TF model .
"""Builds initialization method for the TF model."""
initializer