-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack overflow #14
Comments
Hi @Hust-ShuaiWang, |
Thank you for your reply and I want to ask you some questions which puzzle me. Thank you very much. The format of bias ( ....const q7_t *bias..... )is q7_t and you convert it to q31_t ( int ip_out = ((q31_t)(bias[i]) << bias_shift) + NN_ROUND(out_shift);).Inorder to prevent errors, we have to move (q31_t)bias[i] 24 bits left, but you move it by parameters as bias_shift and I can not understand the meaning of this parameter. |
These two parameters are used to adjust (shift) the weights and data ranges so that they can be represented in 8-bit fixed-point representation without much loss in accuracy. The basic idea is as follows: |
Thank you very much for your reply. The input format of first layer is Q5.2 (which is gotten from mfcc),the weights of first layer is Q0.7 ,so the product of (input * weights) is Qx.9.The bias is Q0.8,the expected format of output is Q5.2. The second layer has the same format of input data as first layer, but the bias_shift and out_shift is 2 and 8.In my understanding, weights and bias in different layers has different ranges and the second layer's weights and bias has different formats as first layer. So the bias_shift and out_shift is different in different layers. If I have done right understanding in that and your weights and bias in different layers are surely different, would you like to mark formats of weights and formats in dnn_weights.h ? I think that will help people make understanding more easily. |
Hi @Hust-ShuaiWang, |
Closing the issue due to inactivity, please reopen it if you still face the issue. |
The "int16_t audio_buffer[16000]=WAVE_DATA;" should not be defined in the main function because it will result in stack overflow when running with some other boards such K64F.
This variable should defined as global variables and store in heap.
The text was updated successfully, but these errors were encountered: