网络中量化操作(1)
1. Generative Adversarial Networks for Extreme Learned Image Compression 2019
量化操作:
# [-2., -1., 0., 1., 2.]
centers = tf.cast(tf.range(-2,3), tf.float32)
# Partition W into the Voronoi tesellation over the centers
w_stack = tf.stack([w for _ in range(L)], axis=-1)
w_hard = tf.cast(tf.argmin(input=tf.abs(w_stack - centers), axis=-1), tf.float32) + tf.reduce_min(input_tensor=centers)
# softmax的结果,最小的值代表最接近的
网络中量化操作(1)最先出现在Python成神之路。
共有 0 条评论