Open TopFox opened 2 years ago
To implement a square root function, you need to approximate the function using a polynomial. numpy.polynomial
contains good interfaces to generate these approximations using different methods. The default evaluation is probably not optimal for homomomorphic encryption and you want to use something like Horner's method to reduce the multiplicative depth of your program.
I found this talk https://www.microsoft.com/en-us/research/video/private-ai-bootcamp-techniques-in-ppml/ useful for understand the contraints of using homomorphic encryption.
In /python/eva/init.py, line 100, in pow: the condition tested is
But it should probably be
str(exponent)
. I think the fact that it has to be an integer and not a float should be tested too.Is there any way to implement sqrt since
x**0.5
is not allowed?Thanks in advance to those who can enlighten me!