I hereby claim:
- I am jvmncs on github.
- I am jvmancuso (https://keybase.io/jvmancuso) on keybase.
- I have a public key ASBM8wtPG4iKMnoJtJe5BUMW5LzNCnji9L3gh-WJzBnKrgo
To claim this, I am signing this object:
| alice = syft.VirtualWorker(hook, “alice”) | |
| x = tf.constant([1., 2., 3., 4.]) | |
| x_ptr = x.send(alice) | |
| print(x_ptr) | |
| # ==> (Wrapper)>[PointerTensor | me:random_id1 -> alice:random_id2] |
| import tensorflow as tf | |
| import syft | |
| hook = syft.TensorFlowHook(tf) |
| def matmul(prot: Pond, | |
| x: PondMaskedTensor, | |
| y: PondMaskedTensor): | |
| a, a0, a1, alpha_on_0, alpha_on_1 = x.unwrapped | |
| b, b0, b1, beta_on_0, beta_on_1 = y.unwrapped | |
| with tf.device(prot.crypto_producer.device_name): | |
| ab = a.matmul(b) | |
| ab0, ab1 = prot._share(ab) |
| import tensorflow as tf | |
| # generic function stubs | |
| def provide_weights(): """Load model weights.""" | |
| def provide_input(): """Load input data.""" | |
| # get model weights/input data | |
| # (both unencrypted) |
| import tensorflow as tf | |
| import tf_encrypted as tfe | |
| # generic remote procedure calls | |
| def provide_weights(): """Load model weights.""" | |
| def provide_input(): """Load input data.""" | |
| def receive_output(): """Receive and decrypt output.""" | |
| # get model weights/input data | |
| # as private tensors from each party |
| import tensorflow as tf | |
| # generic functions for loading model weights and input data | |
| def provide_weights(): """Load model weights as TensorFlow objects.""" | |
| def provide_input(): """Load input data as TensorFlow objects.""" | |
| # get model weights/input data (both unencrypted) | |
| w0, b0, w1, b1, w2, b2 = provide_weights() | |
| x = provide_input() |
| import tensorflow as tf | |
| import tf_encrypted as tfe | |
| # define the parties | |
| tfe.set_config(tfe.RemoteConfig({ | |
| "model-owner": "localhost:2222", | |
| "prediction-client": "1.2.3.4:2222", | |
| "server0": "1.1.1.1:4444", | |
| "server1": "1.1.1.2:4444"}) |
I hereby claim:
To claim this, I am signing this object: