Closed Arman001 closed 3 years ago
I think this is caused by the python print floating-point rule, we can believe the result is accurate (precision loss is normal, it's determined by HE scheme). when you print the result by std::cout, it will auto rounding when the decimal places exceed 6 digits.
Kind of you to reply quickly. :) So, you mean that it is working fine and issue is in just printing? If I keep using computations it will work fine in the end?
By so far, it's working well in my place, you can try this test examples/matrix_operations.py
or refer to @DreamingRaven 's work. Basically, python is just a container, the real work is counting on c++.
Ok I will check more but you are right may be its print floating point working if python. Thank you again.
I will be overhauling my implementation soon, but yeah as @Huelse says feel free to take a look at how I use the bindings. In my version: https://github.com/DreamingRaven/python-fhez (linking to github mirror since this is a github issue)
I have two levels of abstraction reseal which is the lower level rebinding of the C++ to python like serialisation etc. Then a much higher level abstraction that takes reseal and makes it numpy compatible called rearray. Now that I have submitted my paper yesterday I will be looking to change everything to an erray (encrypted-array) abstraction which will clean up and merge the two prior abstractions into one single numpy-compatible way to bind many FHE implementations and make it easier for me to make a working setup.py to install everything directly rather than my docker containers. If you are intending to use RNS-CKKS for deep learning check out my library it might help, if not go right ahead and see if I have used Huelses bindings differently to you if it helps you.
@DreamingRaven I am actually working on encrypted deep learning. I have over viewed your work a bit. I will look into it in detail because this is related to my MS work. Thank you for your kind comment. :)
Type Working not properly on small values like 0.02 etc
Describe I have some experience with SEAL c++ and it works pretty fine in these type of situations. But on smaller values result in this library is not working properly ignoring the decimal point place.
Can you kindly check it on your side. Thank you.