Closed laurilaatu closed 7 months ago
@laurilaatu , is it possible for you to fix the conflicts so we can merge this PR?
@jmitrevs , the conflict is now resolved.
The newly added test fails with:
FAILED test_qkeras.py::test_qsimplernn[Quartus] - AssertionError:
Not equal to tolerance rtol=1e-07, atol=0.1
Mismatched elements: 1 / 4 (25%)
Max absolute difference: 0.953125
Max relative difference: 1.
x: array([[0. , 1.004456, 0.024292, 0.352661]], dtype=float32)
y: array([[0.953125, 0.921875, 0.015625, 0.351562]])
@laurilaatu can you investigate?
@vloncar it seems that the test fails occasionally due to the random initialization. The latest commit fixes the issue by setting the seed. The issue does not affect QLSTM
or QGRU
.
Please let me know if any other changes are required.
Description
The quantizers for kernel, recurrent kernel and bias are retrieved from the QKeras model. State quantizer corresponds to the output precision of the hidden state which is set by altering the default precision (discussed in issue #825). Currently the quantized activations for the RNN layers are not supported.
Type of change
Tests
Test Configuration: Quartus 21.1.0.169.pro
Example usage:
Checklist
pre-commit
on the files I edited or added.