Comments (3)
Hi, this part of the code and its hyper-parameters are mostly adapted from BRECQ. The purpose of this is to find a narrower quantization grid (relative to the min-max which includes all outliers) by minimizing the p-norm. Setting norm = 2.4
gives slightly more weight to outliers in this search than for norm = 2
.
from obc.
Ok thank you. Another question - where exactly is the quantization happening?
- The quantize function is simply a chain of affine tranform, clamping and reverse affine transform. It does not reduce the number of bits to store the weights.
- The
bits
variable is simply used to calculatemaxq
which is used to calculate the scale.
I am unable to find where a fp32
value is stored in a bits
number of bits.
from obc.
I guess you could add an extra line in the quantize
function like so:
def quantize(x, scale, zero, maxq):
q = torch.clamp(torch.round(x / scale) + zero, 0, maxq)
q = convert_q_to_nbits(q, bits)
return scale * (q - zero)
But I get why you didn't do it. Closing the issue now.
from obc.
Related Issues (10)
- All Nan Hinv HOT 6
- 4W4A does not work well
- Only 64.07% Top1 accuracy for ResNet18 on 4w4a HOT 2
- database.py doesn't generate scores results.
- About pruning in Mobilenet_v2 HOT 1
- IndexError: index -10219 is out of bounds for axis 0 with size 10001 when running spdy.py for mixed quantization 2:4 HOT 1
- `TrueOBS.quantize` could be made faster by calculating the inverse Hessian per row only once HOT 1
- Can I experiment with other models and datasets, such as MobileNetV2, VGG11, GoogleNet, etc. Thank you very much!
- How to implement OBC on ConvTranspose2d
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 obc.