Coder Social home page Coder Social logo

ternary-quantization's People

Contributors

vinsis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ternary-quantization's Issues

Accuracy is reduced after 5 epoch

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?

gradient issue

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 .

why not ternery weights?

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.

ValueError: can’t optimize a non-leaf Tensor?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.