INNER CODE UNIT · Python
weight_variable
aiff22/DPED · models.py:85
def weight_variable(shape, name):
initial = tf.compat.v1.truncated_normal(shape, stddev=0.01)
return tf.Variable(initial, name=name)
def bias_variable(shape, name):
initial = tf.constant(0.01, shape=shape)
return tf.Variable(initial, name=name)
def conv2d(x, W):
return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
def leaky_relu(x, alpha = 0.2):
return tf.maximum(alpha * x, x)