MCPcopy Create free account

hub / github.com/OpenMined/SyMPC / functions

Functions591 in github.com/OpenMined/SyMPC

↓ 1 callersMethod_encode
Encode via FixedPointEncoder. Args: data (torch.Tensor): Tensor to be encoded Returns: encoded_data (torch.T
src/sympc/tensor/replicatedshare_tensor.py:107
↓ 1 callersMethod_encode
(self, data)
src/sympc/tensor/share_tensor.py:132
↓ 1 callersMethod_random_prime_group
Computes shares of random number in Zp*.Zp* is the multiplicative group mod p. Args: session (Session): session to generate rando
src/sympc/protocol/falcon/falcon.py:459
↓ 1 callersFunction_reshape_max_pool2d
Prepare the share tensors by calling the reshape function in parallel at each party. Args: x (MPCTensor): the MPCTensor on which to apply
src/sympc/module/nn/functional.py:144
↓ 1 callersMethod_setup_przs
PRZS generator. Setup the Pseudo-Random-Zero-Share generators to the parties involved in the communication. Assume there are
src/sympc/session/session_manager.py:62
↓ 1 callersFunction_tanh_sigmoid
Compute the tanh using the sigmoid approximation. Args: tensor (tensor): values where tanh should be approximated Returns: t
src/sympc/approximations/tanh.py:18
↓ 1 callersFunctionadd_methods_tensor_syft
Add SyMPC methods (only "share") to the torch.Tensor. Raises: ValueError: if torch.Tensor has already the method added.
src/sympc/__init__.py:34
↓ 1 callersFunctioncat
Concatenates the given sequence of seq tensors in the given dimension. Args: tensors (List): sequence of tensors to concatenate d
src/sympc/tensor/static.py:76
↓ 1 callersFunctionchebyshev_series
r"""Computes Chebyshev coefficients. For n = terms, the ith Chebyshev series coefficient is c_i = 2/n \sum_{k=1}^n \cos(j(2k-1)\pi / 4n)
src/sympc/approximations/tanh.py:83
↓ 1 callersMethodconv_transpose2d
Apply the "conv_transpose2d" operation between "self" and "y". Args: weight: the convolution kernel bias: optional bi
src/sympc/tensor/mpc_tensor.py:513
↓ 1 callersFunctioncopy_additional_attributes
Copy attributes from torch layer to SyMPC layer. Args: layer (torch.nn.modules): The torch layer layer_name (str): layer name
src/sympc/module/__init__.py:37
↓ 1 callersMethoddistribute_shares
Distribute a list of shares. Args: shares (List[ShareTensor): list of shares to distribute. session (Session): Sessio
src/sympc/tensor/share_tensor.py:543
↓ 1 callersMethoddistribute_shares
Forward the call to the tensor specific class. Args: *args (List[Any]): list of args to be forwarded **kwargs(Dict[st
src/sympc/protocol/falcon/falcon.py:56
↓ 1 callersMethoddistribute_shares_to_party
Distributes shares to party. Args: shares (List[Union[ShareTensor,torch.Tensor]]): Shares to be distributed. party_ra
src/sympc/tensor/replicatedshare_tensor.py:875
↓ 1 callersMethodeq
Equal operator. Args: other (MPCTensor): MPCTensor to compare. Returns: MPCTensor: Result of the comparison.
src/sympc/tensor/mpc_tensor.py:1132
↓ 1 callersMethodeq_close
Compare two SMPC modules. Args: layer1 (SMPCModule): the first operand for the comparison layer2 (SMPCModule): the se
src/sympc/module/nn/smpc_module.py:9
↓ 1 callersMethodforward
Perform the feedforward and compute the result for the transpose operation. Args: ctx (Dict[str, Any]): Context used to save info
src/sympc/grads/grad_functions.py:96
↓ 1 callersFunctionget_clients
Generate a list of clients given a number. Returns: Callable[[int], List[Any]]: List of clients
benchmarks/conftest.py:14
↓ 1 callersFunctionget_primitive
( store: Dict[Any, Any], nr_instances: int, remove: bool = True, **kwargs )
src/sympc/protocol/fss/fss.py:368
↓ 1 callersMethodget_state
Get the state of a CryptoProvider. Returns: str: CryptoProvider
src/sympc/store/crypto_primitive_provider.py:98
↓ 1 callersMethodget_torch_module
Get a torch module from a given MPC Conv2d module. The parameters of the models are not set. Args: conv_module (Conv2d):
src/sympc/module/nn/conv.py:181
↓ 1 callersMethodgt
Greater than operator. Args: other (MPCTensor): MPCTensor to compare. Returns: MPCTensor: Result of the comp
src/sympc/tensor/mpc_tensor.py:1113
↓ 1 callersFunctionhardtanh
Calculates hardtanh of given tensor. Defined as 1 if x > 1 -1 if x < -1 x otherwise Args: tensor (MPCTensor)
src/sympc/approximations/tanh.py:60
↓ 1 callersMethodinit_generators
Initialize the generators - that are used for Pseudo Random Zero Shares. Args: seed_current (int): the seed for our party
src/sympc/session/session.py:305
↓ 1 callersMethodisub
Apply the "isub" operation between "self" and "y". Args: y (Union["MPCTensor", torch.Tensor, float, int]): self - y Retu
src/sympc/tensor/mpc_tensor.py:417
↓ 1 callersMethodlocal_decomposition
Performs local decomposition to generate shares of shares. Args: x (ReplicatedSharedTensor) : input RSTensor. ring_si
src/sympc/protocol/aby3/aby3.py:214
↓ 1 callersMethodmatmul
Apply the "matmul" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ShareTensor"]): self @ y.
src/sympc/tensor/share_tensor.py:285
↓ 1 callersMethodmatmul
Apply the "matmul" operation between "self" and "y". Args: y (Union["MPCTensor", torch.Tensor, float, int]): self @ y Re
src/sympc/tensor/mpc_tensor.py:463
↓ 1 callersFunctionmse_loss
Mean Squared Error loss. Args: pred (MPCTensor): The predictions obtained target (MPCTensor): The target values reduction
src/sympc/module/nn/functional.py:54
↓ 1 callersMethodmul_malicious
Falcon malicious multiplication. Args: x (MPCTensor): Secret y (MPCTensor): Another secret session (Sessi
src/sympc/protocol/falcon/falcon.py:272
↓ 1 callersMethodreconstruct_state_dict
Reconstruct the shared state dict. Returns: Dict[str, Any]: The reconstructed state dict.
src/sympc/module/nn/conv.py:166
↓ 1 callersMethodsanity_checks
Sanity check to validate that a new instance for MPCTensor can be created. Args: secret (Union[ShareTensor, torch.Tensor, float,
src/sympc/tensor/mpc_tensor.py:211
↓ 1 callersFunctionset_up_model
Create a convolutional network and do a feedforwad. Args: get_clients: Fixture that returns a list of clients Returns: A tup
benchmarks/module/conv_model.py:52
↓ 1 callersMethodshare_state_dict
Share the parameters of the normal Conv2d layer. Args: state_dict (Dict[str, Any]): the state dict that would be shared.
src/sympc/module/nn/conv.py:101
↓ 1 callersFunctionsigmoid
Sigmoid function. Args: x (MPCTensor): The tensor on which we apply the function Returns: An MPCTensor which represents the
src/sympc/module/nn/functional.py:20
↓ 1 callersMethodtruncate
Checks if operation requires truncation and performs it if required. Args: input_tensor (MPCTensor): Result of operation
src/sympc/tensor/mpc_tensor.py:783
Method__eq__
Equal operator. Check if "self" is equal with another object given a set of attributes to compare. Args: oth
src/sympc/tensor/share_tensor.py:387
Method__eq__
Check if "self" is equal with another object given a set of attributes to compare. Args: other (Any): Object to compare
src/sympc/protocol/fss/fss.py:243
Method__eq__
Check if "self" is equal with another object given a set of attributes to compare. Args: other (Any): Object to compare
src/sympc/protocol/falcon/falcon.py:68
Method__eq__
Check if "self" is equal with another object given a set of attributes to compare. Args: other (Any): Object to compare
src/sympc/protocol/aby3/aby3.py:53
Method__eq__
Check if "self" is equal with another object given a set of attributes to compare. Args: other (Any): Session to compare.
src/sympc/session/session.py:316
Method__getattribute__
Get the attribute and check if we should track the gradient. Args: attr_name (str): The name of the attribute Returns:
src/sympc/tensor/mpc_tensor.py:897
Method__getitem__
Allows to subset shares. Args: key (int): The share to be retrieved. Returns: share (torch.Tensor): Returned
src/sympc/tensor/replicatedshare_tensor.py:694
Method__gt__
Greater than operator. Args: y (Union["ShareTensor", torch.Tensor, int]): Tensor to compare. Returns: bool:
src/sympc/tensor/share_tensor.py:339
Method__init__
The initializer for the Linear layer. Args: session (Session): the session used to identify the layer
src/sympc/module/nn/linear.py:37
Method__init__
Initialize Conv2d layer. The stride, padding, dilation and groups are hardcoded for the moment. Args: session (Session):
src/sympc/module/nn/conv.py:47
Method__init__
Initialize ReplicatedSharedTensor. Args: shares (Optional[List[Union[float, int, torch.Tensor]]]): Shares list fr
src/sympc/tensor/replicatedshare_tensor.py:69
Method__init__
Initialize ShareTensor. Args: data (Optional[Any]): The share a party holds. Defaults to None config (Config): The co
src/sympc/tensor/share_tensor.py:102
Method__init__
Initializer for the MPCTensor. It can be used in two ways. ShareTensorControlCenter can be used in two ways: - secret is known by the
src/sympc/tensor/mpc_tensor.py:131
Method__init__
Initialization of the Protocol. Args: security_type : specifies the security level of the Protocol. Raises:
src/sympc/protocol/fss/fss.py:190
Method__init__
Initialization of the Protocol. Args: security_type : specifies the security level of the Protocol. Raises:
src/sympc/protocol/falcon/falcon.py:41
Method__init__
Initialization of the Protocol. Args: security_type : specifies the security level of the Protocol. Raises:
src/sympc/protocol/aby3/aby3.py:39
Method__init__
Initialize a new SGD optimizer. Args: parameters (List[MPCTensor]): Parameters of the module to optimize lr (float):
src/sympc/optim/sgd.py:14
Method__init__
Initialize FP Encoder. Args: base (int): The base for the encoder. precision (int): The precision for the encoder.
src/sympc/encoder/fp_encoder.py:36
Method__init__
Initializer.
src/sympc/store/crypto_store.py:24
Method__init__
(self)
src/sympc/store/crypto_primitive_provider.py:23
Method__init__
Initializer for the Session Manager. Raises: NotImplementedError: This class it is not supposed to be instanciated.
src/sympc/session/session_manager.py:26
Method__init__
Initializer for the Session. Args: parties (Optional[List[Any]): Used to send/receive messages: ring_size (int): Fiel
src/sympc/session/session.py:98
Method__init__
Session configuration. Config can be used inside a Session (see Session) to specify different options that can be used for the Fixed
src/sympc/config/config.py:20
Method__init__
(self, torch_ref)
tests/sympc/module/module_test.py:20
Method__init__
(self, torch_ref)
tests/sympc/module/module_test.py:149
Method__init__
(self, torch_ref)
tests/sympc/store/crypto_primitive_provider_test.py:27
Method__init__
(self, torch_ref)
tests/sympc/grad/grad_functions_test.py:31
Method__init__
Initialize convolutional network. Arguments: torch_ref: Reference to the torch library
benchmarks/module/conv_model.py:21
Method__len__
Return the length of MPCTensor. Returns: int: Length
src/sympc/tensor/mpc_tensor.py:864
Method__lt__
Lower than operator. Args: y (Union["ShareTensor", torch.Tensor, int]): Tensor to compare. Returns: bool: Re
src/sympc/tensor/share_tensor.py:352
Method__new__
Add new methods and properties to the defined tensor classes. Args: name (str): name of the class which has SyMPCTensor metaclass
src/sympc/tensor/tensor.py:16
Method__new__
Control creation of new instances. Args: name (str): Name of the protocol bases: asdf. dct (Dict[Any, Any
src/sympc/protocol/protocol.py:16
Method__repr__
Representation. Returns: str: Representation.
src/sympc/tensor/mpc_tensor.py:889
Method__setitem__
Allows to set share value to new value. Args: key (int): The share to be retrieved. newvalue (torch.Tensor): New valu
src/sympc/tensor/replicatedshare_tensor.py:705
Method__str__
Representation. Returns: str: The representation.
src/sympc/encoder/fp_encoder.py:133
Method_get_truncation_pair
Generates truncation pair for the given MPCTensor. Args: x (MPCTensor): input tensor session (Session) : session of t
src/sympc/protocol/aby3/aby3.py:190
Function_helper_get_clients
(nr_clients: int)
tests/conftest.py:15
Function_helper_get_clients
(nr_clients: int)
benchmarks/conftest.py:21
Method_request_and_get
Function used to request and get a share - Duet Setup. Args: share_ptr (ReplicatedSharedTensor): input ReplicatedSharedTensor
src/sympc/tensor/replicatedshare_tensor.py:745
Method_request_and_get
Function used to request and get a share - Duet Setup. Args: share_ptr (ShareTensor): a ShareTensor Returns:
src/sympc/tensor/share_tensor.py:509
Methodadd
Apply the "add" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ReplicatedSharedTensor"]): self + y
src/sympc/tensor/replicatedshare_tensor.py:416
Methodadd
Apply the "add" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ShareTensor"]): self + y Ret
src/sympc/tensor/share_tensor.py:214
Methodadd
Apply the "add" operation between "self" and "y". Args: y (Union["MPCTensor", torch.Tensor, float, int]): self + y Retur
src/sympc/tensor/mpc_tensor.py:406
Functionadd_primitive
(store: Dict[Any, Any], primitives: Iterable[Any])
src/sympc/protocol/fss/fss.py:358
Methodaddmodprime
Computes addition(x+y) modulo PRIME_NUMBER constant. Args: x (torch.Tensor): input tensor y (torch.tensor): input ten
src/sympc/tensor/replicatedshare_tensor.py:168
Functionargmax
Compute argmax using pairwise comparisons. Makes the number of rounds fixed, here it is 2. This is inspired from CrypTen. Args: x (M
src/sympc/tensor/static.py:232
Methodbackward
Perform the backward pass and compute the gradient for the implemented operation. Args: ctx (Dict[str, Any]): Context used to sav
src/sympc/grads/grad_functions.py:76
Methodbackward
Perform the backward pass for the addition operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information for th
src/sympc/grads/grad_functions.py:147
Methodbackward
Perform the backward pass for the summation operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information for t
src/sympc/grads/grad_functions.py:187
Methodbackward
Perform the backward pass for the substraction operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information fo
src/sympc/grads/grad_functions.py:222
Methodbackward
Perform the backward pass for the substraction operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information f
src/sympc/grads/grad_functions.py:261
Methodbackward
Perform the backward pass for the multiplication operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information
src/sympc/grads/grad_functions.py:301
Methodbackward
Perform the backward pass for the multiplication operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information
src/sympc/grads/grad_functions.py:346
Methodbackward
Perform the backward pass for the division operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information for th
src/sympc/grads/grad_functions.py:385
Methodbackward
Perform the backward pass for the matrix multiplication operation. Args: ctx (Dict[str, Any]): Context used to retrieve the infor
src/sympc/grads/grad_functions.py:423
Methodbackward
Perform the backward pass for the flaten operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information for the
src/sympc/grads/grad_functions.py:482
Methodbackward
Perform the backward pass for the conv2d operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information for the
src/sympc/grads/grad_functions.py:535
Methodbackward
Perform the backward pass for the reshape operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information for the
src/sympc/grads/grad_functions.py:631
Methodbackward
Perform the backward pass for the ReLU operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information for the ba
src/sympc/grads/grad_functions.py:664
Methodbackward
Perform the backward pass for the reshape operation. Args: ctx (Dict[str, Any]): Context used to retrieve the information for the
src/sympc/grads/grad_functions.py:743
Methodbackward
Perform the backward step on the computational graph. Args: gradient (MPCTensor): The gradient (received) from the computational
src/sympc/tensor/mpc_tensor.py:928
Methodbase
Base for the FixedPrecision Encoder. Returns: int: base
src/sympc/encoder/fp_encoder.py:110
Methodbit_decomposition
Perform ABY3 bit decomposition for conversion of arithmetic share to binary share. Args: x (MPCTensor): Arithmetic shares of secr
src/sympc/protocol/aby3/aby3.py:348
Functioncat_replicatedShare_tensor
Helper method that performs torch.cat on the replicated shares of the Tensors. Args: session_uuid_str (str): UUID to identify the session
src/sympc/tensor/static.py:127
← previousnext →101–200 of 591, ranked by callers