MCPcopy Create free account

hub / github.com/OpenMined/SyMPC / functions

Functions591 in github.com/OpenMined/SyMPC

Functioncat_share_tensor
Helper method that performs torch.cat on the shares of the Tensors. Args: session_uuid_str (str): UUID to identify the session on each pa
src/sympc/tensor/static.py:110
Methodcompute_zvalue_and_add_mask
Operation to compute local z share and add mask to it. Args: x (ReplicatedSharedTensor): Secret. y (ReplicatedSharedT
src/sympc/protocol/falcon/falcon.py:349
Functionconv2d_store_add
Add the primitives required for the "conv2d" operation to the CryptoStore. Args: store (Any): The CryptoStore. primitives (Iterab
src/sympc/protocol/beaver/beaver.py:356
Functionconv2d_store_get
Retrieve the primitives from the CryptoStore. Those are needed for executing the "conv2d" operation. Args: store: the CryptoStore
src/sympc/protocol/beaver/beaver.py:378
Functionconv_transpose2d_store_add
Add the primitives required for the "conv_transpose2d" operation to the CryptoStore. Args: store (Any): The CryptoStore. primitiv
src/sympc/protocol/beaver/beaver.py:439
Functionconv_transpose2d_store_get
Retrieve the primitives from the CryptoStore. Those are needed for executing the "conv_transpose2d" operation. Args: store: the Cryp
src/sympc/protocol/beaver/beaver.py:461
Functioncount_wraps_rand
Count wraps random. The Trusted Third Party (TTP) or Crypto provider should generate: - a set of shares for a random number - a set of s
src/sympc/protocol/beaver/beaver.py:505
Functiondecompose
Decompose a tenstor into its binary representation. Args: tensor (torch.Tensor): Tensor to decompose. ring_size (int): Ring size.
src/sympc/utils/mpc_utils.py:126
Methoddistribute_shares
Distribute a list of shares. Args: shares (List[ShareTensor): list of shares to distribute. session (Session): Sessio
src/sympc/tensor/replicatedshare_tensor.py:922
Methoddiv
Apply the "div" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ShareTensor"]): Denominator.
src/sympc/tensor/share_tensor.py:319
Functiondiv_wraps
From CrypTen Privately computes the number of wraparounds for a set a shares. To do so, we note that: [theta_x] = theta_z + [beta_xr] - [
src/sympc/protocol/spdz/spdz.py:234
Methodeq
Equal operator. Check if "self" is equal with another object given a set of attributes to compare. Args: y (Any): Object
src/sympc/tensor/replicatedshare_tensor.py:669
Methodeq
Equal operator. Args: x1 (MPCTensor): First private value. x2 (MPCTensor): Second private value. Returns:
src/sympc/protocol/fss/fss.py:205
Functionevaluate
Evaluate the FSS protocol on the masked and public input `x_masked`. Args: session (Session): MPC Session b: rank of the evaluato
src/sympc/protocol/fss/fss.py:79
Methodfalcon_mask
Falcon mask. Args: x_sh (ReplicatedSharedTensor): X share y_sh (ReplicatedSharedTensor) : Y share op_str
src/sympc/protocol/falcon/falcon.py:246
Methodforward
Perform the feedforward and compute the result for the implemented operation. Args: ctx (Dict[str, Any]): Context used to save in
src/sympc/grads/grad_functions.py:59
Methodforward
Perform the feedforward and compute the result for the addition operation. Args: ctx (Dict[str, Any]): Context used to save infor
src/sympc/grads/grad_functions.py:127
Methodforward
Perform the feedforward and compute the result for the summation operation. Args: ctx (Dict[str, Any]): Context used to save info
src/sympc/grads/grad_functions.py:169
Methodforward
Perform the feedforward and compute the result for the sigmoid operation. Args: ctx (Dict[str, Any]): Context used to save inform
src/sympc/grads/grad_functions.py:207
Methodforward
Perform the feedforward and compute the result for the substraction operation. Args: ctx (Dict[str, Any]): Context used to save i
src/sympc/grads/grad_functions.py:241
Methodforward
Perform the feedforward and compute the result for the multiplication operation. Args: ctx (Dict[str, Any]): Context used to save
src/sympc/grads/grad_functions.py:282
Methodforward
Perform the feedforward and compute the result for the multiplication operation. Args: ctx (Dict[str, Any]): Context used to save
src/sympc/grads/grad_functions.py:322
Methodforward
Perform the feedforward and compute the result for the division operation. Args: ctx (Dict[str, Any]): Context used to save infor
src/sympc/grads/grad_functions.py:365
Methodforward
Perform the feedforward and compute the result for the matrix multiplication operation. Args: ctx (Dict[str, Any]): Context used
src/sympc/grads/grad_functions.py:407
Methodforward
Perform the feedforward and compute the result for the multiplication operation. Args: ctx (Dict[str, Any]): Context used to save
src/sympc/grads/grad_functions.py:464
Methodforward
Perform the feedforward and compute the result for the conv2d operation. Args: ctx (Dict[str, Any]): Context used to save informa
src/sympc/grads/grad_functions.py:500
Methodforward
Perform the feedforward and compute the result for the reshape operation. Args: ctx (Dict[str, Any]): Context used to save inform
src/sympc/grads/grad_functions.py:614
Methodforward
Perform the feedforward and compute the result for the ReLU operation. Args: ctx (Dict[str, Any]): Context used to save informati
src/sympc/grads/grad_functions.py:649
Methodforward
Perform the feedforward and compute the result for the MaxPool2D operation. Args: ctx (Dict[str, Any]): Context used to save info
src/sympc/grads/grad_functions.py:683
Methodforward
Do a feedforward through the layer. Args: x (MPCTensor): the input Returns: An MPCTensor that results by app
src/sympc/module/nn/linear.py:47
Methodforward
Do a feedforward through the layer. Args: x (MPCTensor): the input Returns: An MPCTensor representing the la
src/sympc/module/nn/conv.py:64
Methodforward
(self, x)
tests/sympc/module/module_test.py:25
Methodforward
(self, x)
tests/sympc/module/module_test.py:46
Methodforward
(self, x)
tests/sympc/module/module_test.py:161
Methodforward
(self, x)
tests/sympc/store/crypto_primitive_provider_test.py:31
Methodforward
Do a feedforward through the layer. Args: x (MPCTensor): the input Returns: An MPCTensor representing the la
benchmarks/module/conv_model.py:34
Methodge
Greater or equal operator. Args: other (MPCTensor): MPCTensor to compare. Returns: MPCTensor: Result of the
src/sympc/tensor/mpc_tensor.py:1082
Functiongenerate_primitive
(n_values: int)
src/sympc/protocol/fss/fss.py:348
Methodget_shares
Get shares. Returns: List[torch.Tensor]: List of shares.
src/sympc/tensor/replicatedshare_tensor.py:141
Methodget_torch_module
Get a torch module from a given MPC Layer module. The parameters of the models are not set. Args: linear_module (Linear)
src/sympc/module/nn/linear.py:130
Functionget_triples_conv2d
Get the beaver triples for the conv2d operation. Args: *args: Arguments for _get_triples. **kwargs: Keyword arguments for _get_tr
src/sympc/protocol/beaver/beaver.py:339
Functionget_triples_matmul
Get the beaver triples for the matmul operation. Args: *args (List[ShareTensor]): Named arguments of :func:`beaver.__get_triples`.
src/sympc/protocol/beaver/beaver.py:255
Functionget_triples_mul
Get the beaver triples for the multiplication operation. Args: *args (List[ShareTensor]): Named arguments of :func:`beaver.__get_triples`
src/sympc/protocol/beaver/beaver.py:172
Functionget_triples_transpose2d
Get the beaver triples for the conv_transpose2d operation. Args: *args: Arguments for _get_triples. **kwargs: Keyword arguments f
src/sympc/protocol/beaver/beaver.py:422
Methodgt
Greater than operator. Args: y: self>y Raises: NotImplementedError: Raised when implementation not present
src/sympc/tensor/replicatedshare_tensor.py:658
Functionhelper_argmax_pairwise
Helper function that would compute the difference between all the elements in a tensor. Credits goes to the CrypTen team. Args: sess
src/sympc/tensor/static.py:289
Functionhelper_max_pool2d_reshape
Function that runs at each party for preparing the share. Reshape each share tensor to prepare it for calling 'argmax'. The new share would h
src/sympc/module/nn/functional.py:173
Methodhook_method
Hook a framework method such that we know how to treat it given that we call it. Ex: * if we call "numel" we want to call it on the
src/sympc/tensor/replicatedshare_tensor.py:1007
Methodhook_method
Hook a framework method such that we know how to treat it given that we call it. Ex: * if we call "numel" we want to call it on the
src/sympc/tensor/share_tensor.py:452
Methodhook_method
Hook a framework method. Ex: * if we call "numel" we want to forward it only to one share and return the result (without wra
src/sympc/tensor/mpc_tensor.py:1022
Methodhook_property
Hook a framework property (only getter). Ex: * if we call "shape" we want to call it on the underlying tensor and return the
src/sympc/tensor/replicatedshare_tensor.py:964
Methodhook_property
Hook a framework property (only getter). Ex: * if we call "shape" we want to call it on the underlying tensor and return the
src/sympc/tensor/share_tensor.py:418
Methodhook_property
Hook a framework property (only getter). Ex: * if we call "shape" we want to call it on the underlying share and return the
src/sympc/tensor/mpc_tensor.py:983
Functioninitializer
Set the same event loop to other threads/processes. This is needed because there are new threads/processes started with the Executor
src/sympc/utils/utils.py:66
Methodle
Lower equal operator. Args: x1 (MPCTensor): First private value. x2 (MPCTensor): Second private value. Retur
src/sympc/protocol/fss/fss.py:218
Methodlt
Lower than operator. Args: y: self<y Raises: NotImplementedError: Raised when implementation not present
src/sympc/tensor/replicatedshare_tensor.py:647
Methodlt
Lower than operator. Args: other (MPCTensor): MPCTensor to compare. Returns: MPCTensor: Result of the compar
src/sympc/tensor/mpc_tensor.py:1095
Functionmask_builder
Mask the private inputs. Add the share of alpha (the mask) that is held in the crypto store to the difference x1 - x2. As we aim at compa
src/sympc/protocol/fss/fss.py:45
Methodmatmul
Apply the "matmul" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ReplicatedSharedTensor"]): self@y
src/sympc/tensor/replicatedshare_tensor.py:494
Functionmatmul_store_add
Add the primitives required for the "matmul" operation to the CryptoStore. Args: store (Any): The CryptoStore. primitives (Iterab
src/sympc/protocol/beaver/beaver.py:272
Functionmatmul_store_get
Retrieve the primitives from the CryptoStore. Those are needed for executing the "matmul" operation. Args: store (Dict[Tuple[int, in
src/sympc/protocol/beaver/beaver.py:295
Functionmax_mpc
Compute the maximum value for an MPCTensor. Args: x (MPCTensor): MPCTensor to be computed the maximum value on. dim (Optional[Uni
src/sympc/tensor/static.py:252
Functionmax_pool2d
Compute the max pool for a tensor with 2 dimension. Args: x (MPCTensor): the MPCTensor on which to apply the operation kernel_siz
src/sympc/module/nn/functional.py:237
Functionmax_pool2d_backward
Helper function for the backwards step for max_pool2d. Credits goes to the CrypTen team. Args: grad (MPCTensor): gradient that comes
src/sympc/module/nn/functional.py:384
Functionmax_pool2d_backward_helper
Helper function to compute the gradient needed to be passed to the parent node. Args: input_shape (Tuple[int]): the size of the input ten
src/sympc/module/nn/functional.py:313
Methodmethod
( _self: "ReplicatedSharedTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/replicatedshare_tensor.py:1040
Methodmethod
( _self: "ShareTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/share_tensor.py:477
Methodmethod_all_shares
( _self: "MPCTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/mpc_tensor.py:1038
Methodmethod_new_rs_tensor
( _self: "ReplicatedSharedTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/replicatedshare_tensor.py:1024
Methodmethod_new_share_tensor
( _self: "ShareTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/share_tensor.py:468
Methodmethod_share
( _self: "MPCTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/mpc_tensor.py:1055
Methodmul
Apply the "mul" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ReplicatedSharedTensor"]): self*y
src/sympc/tensor/replicatedshare_tensor.py:455
Methodmul
Apply the "mul" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ShareTensor"]): self * y Ret
src/sympc/tensor/share_tensor.py:253
Functionmul_master
Function that is executed by the orchestrator to multiply two secret values. Args: x (MPCTensor): First value to multiply with. y
src/sympc/protocol/spdz/spdz.py:36
Functionmul_parties
SPDZ Multiplication. Args: session_uuid_str (str): UUID to identify the session on each party side. eps (torch:tensor): Epsilon v
src/sympc/protocol/spdz/spdz.py:125
Functionmul_store_add
Add the primitives required for the "mul" operation to the CryptoStore. Arguments: store (Dict[Any, Any]): the CryptoStore primit
src/sympc/protocol/beaver/beaver.py:189
Functionmul_store_get
Retrieve the primitives from the CryptoStore. Those are needed for executing the "mul" operation. Args: store (Dict[Tuple[int, int],
src/sympc/protocol/beaver/beaver.py:211
Methodmulmodprime
Computes multiplication(x*y) modulo PRIME_NUMBER constant. Args: x (torch.Tensor): input tensor y (torch.tensor): inp
src/sympc/tensor/replicatedshare_tensor.py:216
Methodne
Not Equal operator. Args: y: self!=y Raises: NotImplementedError: Raised when implementation not present
src/sympc/tensor/replicatedshare_tensor.py:715
Methodne
Not equal operator. Args: other (MPCTensor): MPCTensor to compare. Returns: MPCTensor: Result of the compari
src/sympc/tensor/mpc_tensor.py:1145
Methodparameters
Get the parameters of the Linear module. Args: recurse (bool): For the moment not used. TODO Yields: Each pa
src/sympc/module/nn/linear.py:65
Methodparameters
Get the parameters of the Linear module. Args: recurse (bool): For the moment not used. TODO Yields: Each pa
src/sympc/module/nn/conv.py:154
Methodprecision
Get the precision for the FixedPrecision Encoder. Returns: int: precision.
src/sympc/encoder/fp_encoder.py:95
Methodproperty_all_share_getter
(_self: "MPCTensor")
src/sympc/tensor/mpc_tensor.py:999
Methodproperty_getter
(_self: "ReplicatedSharedTensor")
src/sympc/tensor/replicatedshare_tensor.py:995
Methodproperty_getter
(_self: "ShareTensor")
src/sympc/tensor/share_tensor.py:440
Methodproperty_new_rs_tensor_getter
(_self: "ReplicatedSharedTensor")
src/sympc/tensor/replicatedshare_tensor.py:980
Methodproperty_new_share_tensor_getter
(_self: "ShareTensor")
src/sympc/tensor/share_tensor.py:434
Methodproperty_share_getter
(_self: "MPCTensor")
src/sympc/tensor/mpc_tensor.py:1010
Functionprovider_test
This function will generate the values: [((0, 0, 0, 0), (0, 0, 0, 0), ...), ((1, 1, 1, 1), (1, 1, 1, 1)), ...]
tests/sympc/store/crypto_primitive_provider_test.py:38
Functionprovider_test_add
( store: Dict[str, List[Any]], primitives: Iterable[Any] )
tests/sympc/store/crypto_primitive_provider_test.py:63
Functionprovider_test_add
( store: Dict[str, List[Any]], primitives: Iterable[Any] )
tests/sympc/store/crypto_store_test.py:32
Functionprovider_test_get
( store: Dict[str, List[Any]], nr_instances: int )
tests/sympc/store/crypto_primitive_provider_test.py:55
Functionprovider_test_get
( store: Dict[str, List[Any]], nr_instances: int )
tests/sympc/store/crypto_store_test.py:24
Functionpublic_divide
Function that is executed by the orchestrator to divide a secret by a public value. Args: x (MPCTensor): Private numerator. y (Un
src/sympc/protocol/spdz/spdz.py:181
Functionreconstruct
Get back the shares from all the parties and reconstruct the underlying value. Returns: Neural network module with the secret reconstruct
src/sympc/module/__init__.py:86
Methodreconstruct
Reconstruct value from shares. Args: share_ptrs (List[ReplicatedSharedTensor]): List of RSTensor pointers. security_t
src/sympc/tensor/replicatedshare_tensor.py:841
Methodreconstruct
Reconstruct original value from shares. Args: share_ptrs (List[ShareTensor]): List of sharetensors. get_shares (boole
src/sympc/tensor/share_tensor.py:492
Methodreconstruct_state_dict
Reconstruct the shared state dict. Returns: The reconstructed state dict (Dict[str, Any])
src/sympc/module/nn/linear.py:115
Functionregister_add
(func_add)
src/sympc/store/__init__.py:34
← previousnext →201–300 of 591, ranked by callers