google / qkeras

QKeras: a quantization deep learning library for Tensorflow Keras
Apache License 2.0
532 stars 102 forks source link

`keep_negative` parameter in `quantizers.quantized_bits` should be boolean #37

Closed justinchuby closed 4 years ago

justinchuby commented 4 years ago

In https://github.com/google/qkeras/blob/a55548e34f918b0cb224e6372603f9da9f9ffd93/qkeras/quantizers.py#L318-L319

keep_negative is a boolean parameter by its context and documentation. In https://github.com/google/qkeras/blob/a55548e34f918b0cb224e6372603f9da9f9ffd93/qkeras/quantizers.py#L324

it's also converted to one. Is there a reason why its default value is 1, of type int? I might be missing something since I'm new to the package.

zhuangh commented 4 years ago

you are not missing anything. It was just a design choice.

justinchuby commented 4 years ago

I see! Is there a reason why it was designed this way?

zhuangh commented 4 years ago

Justin @justinchuby actually this is a good point and we change accordingly in the comment mentioned above. Thanks. Let me know if you have more question.

justinchuby commented 4 years ago

Amazing! Thanks @zhuangh. I'll close the issue.