Research Article
FPGA-Based Real-Time Embedded Fish Embryo Detection System
Algorithm 1
Quantization algorithm for each layer.
| Full precision inputs, weights and bias, outputs: | | Bit width: for inputs and weights, b = 4, for bias, b = 8 | | Output: Y, predict number: Label | (1) | Calculate q(x), q(w), q(bias) according to equation (6) | (2) | Y = Forward(q(x), q(w), q(bias)) | (3) | Calculate losses and regularize all learnable parameters: L = loss (, Label) | (4) | According to Equation (8), calculate gradient: | (5) | Use the Adam optimizer [31] to update a portion of the full precision parameters according to Equation (9); W = Backward (W, Adam, ) | (6) | Returning to 1. |
|