Versatile-Image-Compression
Versatile-Image-Compression copied to clipboard
ce_loss calculate code
Hi, it's a nice work! Your code is easy to understand, however, I still have some questions.
-
In entropy_codec.py file. What is the function of variable c? Why multiply each ce_loss loss by c?
c = tf.pow(tf.pow(2, (4-4-i)), 2) -
Why divide the total ce_loss by 256?
return ce_loss / 256 -
In
pixelcnn_2D.pyandpixelcnn_2D_context.pyfiles, the cross_entropy is calculate withcross_entropy = -tf.reduce_mean(tf.log(prob)). There seems to be something wrong, becuasetf.log(x)meansln(x), notlog_2(x). -
Can you share your compress and decompress code?
Look forward to your reply, and I would appreciate it very much.