Hello,
I've run the ristretto tool on a 152 layer deep ResNet, with the following results. It seems that 8 bit weights are sufficient for convolution and fully connected layers. However, dynamic fixed point activations kill accuracy. Is there a logical explanation for this (perhaps it's to be expected?), and if so, is there a way to enable dynamic fixed point for CONV/FC only? I don't seem to find a way to turn dynamic fixed point layer activations on/off individually for the resulting quantized network.
Thanks!
--nico
I0708 18:53:41.303802 70469 quantization.cpp:136] accuracy_top5 = 0.005
I0708 18:53:41.788223 70469 quantization.cpp:259] ------------------------------
I0708 18:53:41.788274 70469 quantization.cpp:260] Network accuracy analysis for
I0708 18:53:41.788278 70469 quantization.cpp:261] Convolutional (CONV) and fully
I0708 18:53:41.788281 70469 quantization.cpp:262] connected (FC) layers.
I0708 18:53:41.788285 70469 quantization.cpp:263] Baseline 32bit float: 0.749002
I0708 18:53:41.788295 70469 quantization.cpp:264] Dynamic fixed point CONV
I0708 18:53:41.788297 70469 quantization.cpp:265] weights:
I0708 18:53:41.788300 70469 quantization.cpp:267] 16bit: 0.749022
I0708 18:53:41.788305 70469 quantization.cpp:267] 8bit: 0.747182
I0708 18:53:41.788308 70469 quantization.cpp:267] 4bit: 0.001
I0708 18:53:41.788312 70469 quantization.cpp:270] Dynamic fixed point FC
I0708 18:53:41.788316 70469 quantization.cpp:271] weights:
I0708 18:53:41.788317 70469 quantization.cpp:273] 16bit: 0.749022
I0708 18:53:41.788321 70469 quantization.cpp:273] 8bit: 0.749422
I0708 18:53:41.788326 70469 quantization.cpp:273] 4bit: 0.686141
I0708 18:53:41.788329 70469 quantization.cpp:275] Dynamic fixed point layer
I0708 18:53:41.788331 70469 quantization.cpp:276] activations:
I0708 18:53:41.788334 70469 quantization.cpp:278] 16bit: 0.0266003
I0708 18:53:41.788338 70469 quantization.cpp:281] Dynamic fixed point net:
I0708 18:53:41.788341 70469 quantization.cpp:282] 8bit CONV weights,
I0708 18:53:41.788344 70469 quantization.cpp:283] 8bit FC weights,
I0708 18:53:41.788347 70469 quantization.cpp:284] 0bit layer activations:
I0708 18:53:41.788349 70469 quantization.cpp:285] Accuracy: 0.001
I0708 18:53:41.788353 70469 quantization.cpp:286] Please fine-tune.
11932:I0708 16:04:55.599607 70469 quantization.cpp:155] Layer res2b_branch2c, integer length input=4, integer length output=4, integer length parameters=-1 |
https://gist.github.com/6aef923f66f4a5573c9df0e71ce6fc14
You can use the weights from here: https://onedrive.live.com/?authkey=%21AAFW2-FVoxeVRck&id=4006CBB8476FF777%2117887&cid=4006CBB8476FF777