vinsis / ternary-quantization Goto Github PK
View Code? Open in Web Editor NEWTraining models with ternary quantized weights using PyTorch
License: MIT License
Training models with ternary quantized weights using PyTorch
License: MIT License
Hey, do you try to train lots of epoches? I found that the accuracy will be reduced after 5 epoch, until to 10%. It really confused me, could u please give me a hand?
HI, @vinsis Thanks for the pytorch implementation of the TTN.
I have an issue about the code. In quantionization.py line14:
should full_precision_grad = a * full_precision_data * w_p_data + b * full_precision_data * w_n_data + c * full_precision_data * 1
be
full_precision_grad = a * grad_data* w_p_data + b * grad_data* w_n_data + c * grad_data* 1
?
It seems the original gradient not used if employing full_precision_data .
hi, @vinsis
I wonder if you have tried on other datasets or networks? For example,
the listed case in https://github.com/czhu95/ternarynet (which seems to be the repo by the paper author).
I spent many time and couldn't recover the reported accuracy in the paper.
Hello, I managed to perform your quantized neural network in my machine. however, the trained weights are like this (a kernel):
[[[ 0.0000, 0.0000, 0.4256],
[ 0.0000, 0.4256, -1.4813],
[ 0.0000, 0.0000, 0.0000]]],
all the weights I got is like this. It seems like not a ternary weights which should be [-A, 0 , A], is it and why?
cheers.
change {scaling_factors = [torch.ones(2, requires_grad=True).to(device) for _ in range(len(weights_to_be_quantized))]}
to
{scaling_factors = [torch.ones(2, requires_grad=True, device=device) for _ in range(len(weights_to_be_quantized))]}
works
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.