Comments (3)
Maybe I have not fully understand the question. Regarding "operations" between layers, you can put
- quantizer inside one layer like https://github.com/google/qkeras/blob/master/examples/example_qoctave.py#L49
- Or add QActivation layer before or after one layer, like
https://github.com/google/qkeras/blob/master/examples/example_mnist.py#L82
and make the tensors to be quantized.
Let me know if I answered the wrong question.
Thanks!
from qkeras.
Hi,
what I meant is that, for example, you have two quantized parameters: x
and y
. However, when you multiply them together x*y
the result will still be a float32
and not be quantized anymore.
Would it happen here? and what should I do to prevent it from happening?
Duc.
from qkeras.
Let's assume the mac
(multiplication-and-addition) has enough bits to hold x*y
(mult=x*y
, mac += mult
). Then, use that datatype to implement mac
in hardware.
FYI, we have been working on tool inside qkeras to derive mac
datatype automatically. For example, when x
is quantized_bits(bits=4, integer=1, keep_negative=0)
, y
is quantized_bits(bits=2, integer=1, keep_negative=0)
, mult
could be quantized_bits(bits=6, integer=2, keep_negative=0)
, and set mac
type correspondingly. There are different types of quantizers and operations, so we need to map them accordingly. This will make hardware datatype setup easy. So stay tune.
To simulate the numerical behavior, I suggest you apply QActivation
layer or SomeLayer(..., activation=quantizer)
to ensure the model accuracy.
Hope it makes sense. Feel free to keep discussions in this thread!
from qkeras.
Related Issues (20)
- Error in energy estimation for AveragePooling2D layers
- Using Auto HOT 1
- Very low accuracy following AutoQKeras notebook and CUDA error HOT 1
- How low precision weights and biases are stored in QKeras? HOT 4
- When I use QKeras: Failed to load in-memory CUBIN: CUDA_ERROR_NO_BINARY_FOR_GPU: no kernel image is available for execution on the device [Op:Abs] HOT 2
- Params not quantized after model_save_quantized_weights function HOT 4
- Only Qconv layer's output tensors are quantized
- Cannot convert 6.0 to EagerTensor of dtype int64
- How do I save an AutoQKeras model that a different script can load?
- `pyparser` vs `pyparsing`
- Can QKeras support Full integer quantization HOT 8
- Add a custom layer with a bitwise operation
- TFLite compatibility
- How can I get the scale of the QAdaptiveActivation layer
- How do keras and qkeras versions correspond to each other?
- Difference between Qkeras model and Keras model HOT 9
- Adding QKeras to conda forge
- GPU Inferencing in Qkeras
- Any documentation for AutoQkeras?
- Inference of QKeras models HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qkeras.