Skip to content

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