(fan, constant=1)
return tf.random_uniform((fan_in, fan_out),
                             minval=low, maxval=high,
                             dtype=tf.float32)
Xavier initialization of network weights.
Xavier initialization of network weights.
Xavier initialization of network weights .
def init_xavier(fan, constant=1):
    """Xavier initialization of network weights."""
    fan_in, fan_out = fan[0], fan[1]
    low = -constant * np.sqrt(6.0 / (fan_in + fan_out))
    high = constant * np.sqrt(6.0 / (fan_in + fan_out))
    return tf.random_uniform((fan_in, fan_out),
                             minval=low, maxval=high,
                             dtype=tf.float32)
def init_xavier ( fan , constant = 1 ) : fan_in , fan_out = fan [ 0 ] , fan [ 1 ] low = - constant * np . sqrt ( 6.0 / ( fan_in + fan_out ) ) high = constant * np . sqrt ( 6.0 / ( fan_in + fan_out ) ) return tf . random_uniform ( ( fan_in , fan_out ) , minval = low , maxval = high , dtype = tf . float32 )