factor=2.0, mode="FAN_IN", uniform=False, dtype=tf.float32)):
Returns a tensor with the requested shape, initialized
using the provided intitializer (default: He init).
return tf.get_variable(
name, shape=shape, initializer=initializer, dtype=tf.float32)
def bias(name, shape, initializer=tf.constant_initializer(value=0.0)):
Returns a bias variabile initializeted wuth the provided initializer
After Change
name, shape=shape, initializer=initializer, dtype=tf.float32)
// show weights of the first layer
if len(shape) == 4 and shape[3] in (1, 3, 4):
tf_log(tf.summary.image(name, weights, max_outputs=10))
tf_log(tf.summary.histogram(name, weights))
return weights