Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- weights = _variable_with_weight_decay('weights', shape=[dim, 384],
- stddev=0.1, wd=0.0)
- biases = _variable_on_cpu('biases', [384], tf.constant_initializer(0.001))
- wx = tf.matmul(reshape, weights)
- biases_mul = tf.multiply(biases,0.001)
- wx_biases = tf.add(wx,biases_mul)
- w_square= tf.square(weights)
- w_sum = tf.reduce_sum(w_square,0)
- biases_square = tf.square(biases)
- w_biases = tf.add(w_sum,biases_square)
- w_norm = tf.sqrt(w_biases)
- x_square = tf.square(reshape)
- x_sum = tf.reduce_sum(x_square,1,keep_dims=True)
- biases_send_square = tf.square(0.001)
- x_biases = tf.add(x_sum, biases_send_square)
- x_norm = tf.sqrt(x_biases)
- wx_norm_w = tf.div(wx_biases,w_norm)
- wx_norm = tf.div(wx_norm_w,x_norm)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement