Federation API¶
Low level api¶
Classes:
federation, get or remote objects and tables |
- class FederationABC¶
federation, get or remote objects and tables
Methods:
get(name, tag, parties, gc)get objects/tables from
partiesremote(v, name, tag, parties, gc)remote object/table to
parties- abstract get(name: str, tag: str, parties: List[fate_arch.common._types.Party], gc: fate_arch.abc._gc.GarbageCollectionABC) List¶
get objects/tables from
parties- Parameters
name (str) – name of transfer variable
tag (str) – tag to distinguish each transfer
parties (List[Party]) – parties to get objects/tables from
gc (GarbageCollectionABC) – used to do some clean jobs
- Returns
a list of object or a list of table get from parties with same order of parties
- Return type
list
- abstract remote(v, name: str, tag: str, parties: List[fate_arch.common._types.Party], gc: fate_arch.abc._gc.GarbageCollectionABC) NoReturn¶
remote object/table to
parties- Parameters
v (object or table) – object/table to remote
name (str) – name of transfer variable
tag (str) – tag to distinguish each transfer
parties (List[Party]) – parties to remote object/table to
gc (GarbageCollectionABC) – used to do some clean jobs
- Return type
Notes
user api¶
remoting or getting an object(table) from other parties is quite easy using apis provided in Variable.
First to create an instance of BaseTransferVariable, which is simply a collection of Variables:
from federatedml.transfer_variable.transfer_class import secure_add_example_transfer_variable
variable = secure_add_example_transfer_variable.SecureAddExampleTransferVariable()
Then remote or get object(table) by variable provided by this instance:
# remote
variable.guest_share.remote("from guest")
# get
variable.guest_share.get()