AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.71k stars 7.96k forks source link

Could you please explain the benifit of ConvX layers in yolov3-tiny_xnors.cfg? #1581

Open ChenCong7375 opened 6 years ago

ChenCong7375 commented 6 years ago

It is fantastic to see something new in darknet! You fixed yolov3-tiny_xnors.cfg but I don't really understand the ConvX layers(xnor=1). Could you please explain why you choose the ConvX layers ?

AlexeyAB commented 6 years ago

These layers (ConvX) use 1-bit operations (xnor, bit_count) instead of float-32-bit operations (multiply, add). It is at least 5x times faster. It looks like that 1-bit weights and inputs are enough for the middle layers: https://github.com/AlexeyAB/darknet/issues/1472

XNOR-gemm: https://github.com/AlexeyAB/darknet/blob/57e878b4f9512cf9995ff6b5cd6e0d7dc1da9eaf/src/gemm.c#L1611-L1645


XNOR-gemm is optimized with AVX2: https://github.com/AlexeyAB/darknet/blob/57e878b4f9512cf9995ff6b5cd6e0d7dc1da9eaf/src/gemm.c#L840-L897

ChenCong7375 commented 6 years ago

thank u I am going to train a model with the cfg the faster the better