Open eduardo-sarmento opened 4 months ago
Hello, I have a feeling that your problem can be resolved by a solution described here.
I don't think so, in the link that you shared in the error the list of available reescalings was empty, but in my case the list has reescalings, [30 60]. I also tested with more qi_sizes, up to 20*[30], but it did not have any effect on the error.
Description Hello. I have been trying to implement the Central Kernal Aligment(CKA) similarity with Fully Homomorphic Encryption using Pyfhel. However, I have been running into the Value Error: encrypted1 and encrypted2 parameter mismatch in the last line of the implementation (result = top*bottom). I read in the documentation that using the rescale_to_next and align_mod_n_scale methods can resolve this problem, but when I use them I get a "cannot align scales 30 and 120: available rescaling [30 60]" warning. Most strangely is that sometimes it works when I use those methods, and it keeps working for a time, but if I try the same code latter it suddenly stops working.
Code To Reproduce Error
ValueError Traceback (most recent call last) in <cell line: 133>()
131 ctxt_BTB = HE.encrypt(BTB)
132
--> 133 cka_ab = cka(ctxt_a, ctxt_b_transposed, ctxt_ATA, ctxt_BTB, HE , crypt=True)#cka(ctxt_a, ctxt_b_transposed, ctxt_ATA, ctxt_BTB, HE , crypt=True)
134 print(HE.decrypt(cka_ab)[0])
1 frames in cka_encrypted(X, Y, XTX, YTY, HE)
50 #print(bottom)
51
---> 52 result = bottom * top
53 #print("result encrypted")
54 #print(HE.decrypt(result))
Pyfhel/PyCtxt.pyx in Pyfhel.PyCtxt.PyCtxt.mul()
Pyfhel/Pyfhel.pyx in Pyfhel.Pyfhel.Pyfhel.multiply()
ValueError: encrypted1 and encrypted2 parameter mismatch Setup: This setup is being run in a Docker container, but this problem has presented itself when I run it using google colab as well