Rosetta
Rosetta copied to clipboard
how to read the source code
I have successfully run all examples in this project.Could you please tell me the correct order to learn about the project's code?
Firstly, you can read the doc and rethink how Rosetta works among parties. I'm sure that you've already know something about customizing operations in Tensorflow, and you are eagerly curious about how Rosetta replace the original operations in Tensorflow. You now can navigate the source code of Rosetta to find the Rosetta-style integration of Privacy-Preserving Computing with TF-like operations.
Take an operation named matmul
as an instance, you can use it like this, and tf.matmul
here is replaced by Rosetta, so you can use your favourite editor to navigate the source code of matmul
. Besides, the idea of replacing tf.matmul
is simple: writing a custom matrix multiplication operation according to Tensorflow docs, using it in your machine learning tasks and improve the code to reuse it neatly. To be concrete, if you use Rosetta, your data must be sensitive towards data safety, so implementation of the custom matrix multiplication operation follow the Privacy-Preserving computation protocols, thus assuring the theoretical and practical safety respectively.
Moreover, if your curiousity is not only on Rosetta but also on Privacy-Preserving computation protocols, you can refer to SecureNN and Rosetta's Helix. Implementations of those protocols lie in code. Those protocols provide with systematic solutions and boostinig themselves, so you can follow this repository.
If you have little patience on comprehending safety but still have considerations on safety, you can skip the source code, and try to use Rosetta in a more complicated task like training CIFAR-100 and testify the safety and other performances. We are looking forward to your issues and pull requests.
@YZY010203
Just as @Milkve said, you can start with a specific TF operator, such as matmul
, and trace all the way from it API usage to its back-end cryptographic implementation.
BTW, the best way to learn the design and inner mechanism about Rosetta is to join us, join our community! If you are interested, please contact us.
:-)
Thank you very much,I will learn the inner mechanism about Rosetta as you say.In addition,what should I do to join the community?
Thank you very much,I will learn the inner mechanism about Rosetta as you say.In addition,what should I do to join the community?
WELCOME! You can send direct messages to me in our slack workspace, or email me [email protected].
@Milkve When I debug the code,I face a question.Take this demo in an instance,to run and debug the code ,I should activate the secureNN protocol which need three nodes separately input "python demo.py --party_id=0" in my IDE,so could you please tell me how to dubug the code and activate the secureNN in the same time ? Thank you very much!
@Milkve When I debug the code,I face a question.Take this demo in an instance,to run and debug the code ,I should activate the secureNN protocol which need three nodes separately input "python demo.py --party_id=0" in my IDE,so could you please tell me how to dubug the code and activate the secureNN in the same time ? Thank you very much!
You can open three terminals in your IDE, for example, in VS Code, firstly open one bash,
and here you get one terminal,
then click the +
to add two terminals,
and now you can execute your code in three terminals.
Another way is just using your IDE as an editer and execute code in real terminals your system provided. In Ubuntu 18.04 Desktop with default GNOME desktop, you can call out terminal using Ctrl
+ Alt
+ T
and the copy&paste commands in terminal turn into Ctrl
+ Shift
+ C
and Ctrl
+ Shift
+ V
.
If you prefer other IDE, you can also find steps to open multiple terminals in your preferred IDE similarly.