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

Change The kernel_range of QLayers #4

Closed
Guyume opened this issue Dec 16, 2019 · 0 comments
Closed

Change The kernel_range of QLayers #4

Guyume opened this issue Dec 16, 2019 · 0 comments

Comments

@Guyume
Copy link

Guyume commented Dec 16, 2019

Thanks for your works, it's quite convenient for us who want to quantizate model.
But some things I get confused when I use it, so I hope to get your help if possible.

That is, I find the the config of Qlayers like QDense has the item named "kernel_range=1.0", does it constrain the weight within the range or something else?

https://github.com/google/qkeras/blob/92ec6d37c97c27a5ac9d59e0629ced0ddc432a20/qkeras/qlayers.py#L736
kernel_range=1.0,

Second is quantized_bit. the code make the max(x)=1, min(x)=-1, but mine max(x) and min(x) are much smaller than 1 or -1, and varies by layers, I think if make them 1 and -1 then make quantization will loss many quantization levels unused, so I want to know is there any way to change the max(x) or min(x) by layers, e.g pass it in q_dict like /examples/example_keras_to_qkeras.py?

https://github.com/google/qkeras/blob/92ec6d37c97c27a5ac9d59e0629ced0ddc432a20/qkeras/qlayers.py#L202
1) max(x) = +1, min(x) = -1 2) max(x) = -min(x)

Thanks again!

I think I have solved the issue, thanks again for your amazing library

@Guyume Guyume closed this as completed Dec 16, 2019
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

No branches or pull requests

1 participant