














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















INPUT OUTPUT 0 64 1 64 127 64 128 192 254 192 255 192
∑ i = 1
∑ MSE € MSE = 1 MN v ij − v ˆ ( (^) ij )
j = 1
∑ i = 1
∑ € ( v − v ˆ ) 2 € v − v ˆ € MAE = 1 MN v (^) ij − v ˆ (^) ij j = 1
∑ i = 1
∑
Value Code 64 A 192 B
INPUT Code A 64 B 192
€ v
€ v^ ˆ
The applica6on of quan6za6on is not limited to scalar variables, it is ocen applied to vector variables, where it is called Vector Quan6za6on or VQ. Advantage of VQ over SQ:
Value Code 192,80,80 A 80,16,64 B 208,96,96 C 176,64,80 D
INPUT Code A 192,80, B 80,16, C 208,96, D 176,64,
def encode(vector, codebook): dist = sys.maxint index = - for j in xrange(len(codebook)): d = 0 code = codebook[j] for i in xrange(len(vector)): d += (vector[i] - code[i])** if (d < dist): dist = d index = j return index def mse(a, b): d = 0 for i in xrange(len(a)): d += (a[i] - b[i])** return sqrt(d) Two key routines
Original (^) Most Popular 64, 12-bit Colors MAE = 15. Original (^) Most Popular 64, 12-bit Colors MAE = 9.
Voronoi Cell Analogy