NervanaSystems / he-transformer

nGraph-HE: Deep learning with Homomorphic Encryption (HE) through Intel nGraph
Apache License 2.0
221 stars 39 forks source link

How do compute biases for merged layers. #270

Closed Musawar71 closed 5 years ago

Musawar71 commented 5 years ago

I am working on cryptonets, the issue for me is to generate biases while merging layers, so can you please elaborate the method for generate biases

fboemer commented 5 years ago

Currently, we only merge layers with no biases. The composition of linear layers with biases is also a linear layer with a bias, so this is possible as well. For example,

W_2(W_1x + b_1) + b2 => W_2W_1x + (W_2b_1 + b_2)