You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "Pyfhel/PyCtxt.pyx", line 360, in Pyfhel.PyCtxt.PyCtxt.add
File "Pyfhel/Pyfhel.pyx", line 1050, in Pyfhel.Pyfhel.Pyfhel.add_plain
File "Pyfhel/Pyfhel.pyx", line 1070, in Pyfhel.Pyfhel.Pyfhel.add_plain
ValueError: scale mismatch
How can I resolve this error?
I use homomorphic encryption in neural networks. At the full connection layer, the encrypted data has been weighted, but this error occurs when adding with bias.
Hi @scutyuqiu, I reviewed issues on Pyfhel and demos, I found one that is helpful for you to read (exploring CKKS pitfalls).
I can recall that I faced similar issue and fixed that with rescaling (HE.rescale) as also pointed out in this issue on SEAL because when you are doing multiplication, you'll have ciphertext in different scale (compared to addition/subtraction) then addition wont work properly as you desired.
qi_size is about the number of bits of each prime in the chain to ensure precision in encoding and decoding. However, I also dont have any connection now in mind between your scale mismatch and qi_size.
File "Pyfhel/PyCtxt.pyx", line 360, in Pyfhel.PyCtxt.PyCtxt.add
File "Pyfhel/Pyfhel.pyx", line 1050, in Pyfhel.Pyfhel.Pyfhel.add_plain
File "Pyfhel/Pyfhel.pyx", line 1070, in Pyfhel.Pyfhel.Pyfhel.add_plain
ValueError: scale mismatch
How can I resolve this error?
I use homomorphic encryption in neural networks. At the full connection layer, the encrypted data has been weighted, but this error occurs when adding with bias.
code.docx
The text was updated successfully, but these errors were encountered: