Skip to content
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

Update normalization functions #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dnoonan08
Copy link
Contributor

Update to the normalize and unnormalize functions to allow bit-shift normalization. This scheme is designed to mimic the normalization as implemented in HLS, where instead of dividing by the sum (or max), everything is actually just bit-shifted based on the MSB location of the sum (or max).

Ex:
an array or charges q = [37, 5, 1, 0]
The sum is 43, but instead of normalizing to 43, things are normalized to the MSB of the sum (32)
normalized_q = [37/32, 5/32, 1/32, 0]

Additionally, the normalize function also includes arguments for bits and integer, in order to perform the quantization of the data during the normalize step.

Finally, internal workings of the functions have been updated to use numpy array operations, removing the need for the for loop and numba compilation. This should speed up the normalize function, since numba.jit was not able to compile in nopython mode.

normalize and unnormalize functions have been checked that they agree with the output of the original functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant