Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blob ternarization #6

Open
HahTK opened this issue Jun 6, 2017 · 0 comments
Open

Blob ternarization #6

HahTK opened this issue Jun 6, 2017 · 0 comments

Comments

@HahTK
Copy link

HahTK commented Jun 6, 2017

In the Blob::TernaryToProto() function we seem to be using 0.5*alpha as delta instead of the actual value of delta. Is there a reason for doing it this way ?

const double* data_vec = cpu_binary();
for (int i = 0; i < count_; i += 16) {
unsigned int n = 0;
for(int j=0; j<16 && (i+j)<count_; j++){
int b1 = data_vec[i+j] > -0.5alpha ? 1 : 0;
int b2 = data_vec[i+j] > 0.5
alpha ? 1 : 0;
n ^= (b1 << (2j));
n ^= (b2 << (2
j+1));
}
proto->add_ternary_data(n);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant