Open KangolHsu opened 7 years ago
maybe the value saved is ‘wT*wMax’ the value of wT is combination of power of 2 wMax is the max value in weights。 am i right?
@KangolHsu yes, I presume that the weights are normalized using some constant that is wMax to increase bit-width efficiency. It is possible to make it power of two as well at the expense of potentially 1 bit increase in bit-width.
I set N = 1 B = 8 but the result of wT is in the range of 2^-2 to 2^-15 i am confused.why that happen? one more question,how to save the index of each codebook entry?and could you give me some clues?
I use your scrip convert my float model to power of 2 but i get weights like this conv1_weight:
0.068853, -0.041312, -0.020656, -0.096395, -0.123936, 0.068853, 0.061968, 0.068853, 0.013771, 0.048197, -0.113608, 0.048197, 0.068853, 0.058525, -0.051640, 0.041312, 0.034427, 0.041312, -0.068853, -0.055083, 0.068853, 0.034427, -0.013771, 0.068853, 0.068853, -0.103280, -0.041312, -0.082624, 0.024099, 0.020656, -0.068853, 0.006885, 0.082624, 0.010328, -0.027541, -0.068853, -0.034427, -0.103280, 0.027541, -0.082624, -0.030984, 0.041312, 0.013771, 0.068853, -0.061968, -0.082624, 0.110165, -0.006885, 0.068853, 0.103280, 0.055083, -0.096395, 0.068853, 0.061968, 0.013771, 0.117050, 0.096395, -0.061968, -0.103280, 0.020656, -0.013771, -0.103280, 0.034427, -0.003443, 0.082624, 0.096395, 0.006885, -0.082624, 0.082624, -0.048197, -0.096395, -0.068853, -0.017213, 0.034427, 0.137706, 0.020656, 0.041312, 0.034427, 0.137706, 0.048197, -0.082624, 0.034427, -0.082624, -0.137706, 0.082624, 0.137706, 0.165248, -0.103280, -0.061968, -0.096395, -0.020656, 0.223773, 0.165248, 0.068853, 0.013771, 0.020656, 0.113608, 0.000000, -0.034427, -0.096395, 0.000000, -0.068853, 0.061968, 0.110165, 0.055083, -0.082624, -0.137706, -0.275413, -0.275413, 0.048197, -0.048197, 0.165248, -0.165248, -0.234101, 0.030984, 0.192789, 0.234101, 0.017213, 0.006885, -0.068853, -0.123936, -0.013771, 0.165248, 0.027541, 0.137706, 0.082624, -0.096395, -0.113608, 0.030984, 0.034427, 0.000000, 0.082624, -0.123936, -0.165248, -0.051640, 0.082624, 0.165248, -0.123936, -0.234101, -0.103280, 0.103280, 0.247872, 0.103280, 0.058525, -0.055083, -0.137706, 0.082624, -0.068853, 0.000000, 0.006885, 0.000000, -0.137706, -0.006885, -0.082624, 0.000000, 0.013771, -0.017213, -0.068853, -0.055083, 0.000000, -0.027541, 0.020656, 0.082624, -0.068853, 0.068853, 0.017213, 0.103280, 0.103280, -0.082624, -0.051640, -0.082624, 0.123936, 0.048197, 0.041312, 0.096395, 0.041312, -0.165248, -0.055083,
some of them are the same,but it was not power of 2 i use my own caffe version。what wrong with me? thanks