Federated Learning API
Last updated
Last updated
With SymetryML Federated Learning can be organized in a centralized manner, where only the administrator has access to information sharing and model building, or a decentralized framework where all peers in the federation have access to information sharing and model building. There is also the option to create a hybrid Federated Learning network which can be a combination of centralized and decentralized federated learning networks.
Creating a federation starts with a single node, the Administrator of the Federation. The administrator is responsible for creating the federation, inviting peers to join the federation, and determining how often the federation will share information, otherwise known as the “sync” schedule or frequency of sharing information.
For more details on the various topologies available when using federated learning with SymetryML please consult documentation.
Please consult the following for details on how to create a federation depending on if you are using [NATS] (https://www.nats.io) or backed federation.
AWS :
NATS :
This rest call returns the information about the federation. The information is returned encrypted with the user secret key, that is the SymetryML user key.
200
OK
Success.
400
BAD REQUEST
SymetryML project does not exist. {"statusCode":"BAD_REQUEST","statusString":"Cannot Find SYMETRYML id[r5] for Customer id [c1]","values":{}
See the example below.
This Rest endpoint is used in order to get 'an invite' to join the federation by the administrator of the federation. The body of the request contain the password to use to encrypt the resulting encryptedGroupInfo
can then be shared with another peer so that they can join. Please note that encryptedGroupInfo
can only be used 1 time. For each peer that want to join the federation a unique encryptedGroupInfo
needs to be generated.
encryptedGroupInfo
Contains the information necessary for a peer to join a federation encrypted with the password provided in the body of the request.
passwd
Required
Password to use to encrypt the federation information
fed_rest_host
Required
Hostname where admin can be reach at.
200
OK
Success.
400
BAD REQUEST
SymetryML project does not exist. {"statusCode":"BAD_REQUEST","statusString":"Cannot Find SYMETRYML id[r5] for Customer id [c1]","values":{}
The response will be stored in the encryptedGroupInfo
entity which is a string. That string is a json encoded string encrypted with the provided password. Once decrypted you get a <string, string> map that contains some of the following key: The response token fed_req_token
can only be used one time.
sync_sched
fed_name
fed_secret_key
fed_req_token
for AWS based federation:
aws_topic_arn
aws_topic_region
for Nats based federation:
nats_hosts
nats_sec_user
nats_sec_passwd
nats_sec_token
nats_sec_nkey_seed
Once decrypted the Federation info will contains information like in the following example. This is basically a map with a few key/ value pair. These key value pairs must be used when joining a federation.
Please consult the following sections for details on how to join an existing federation depending on if you are using Nats (www.nats.io) or AWS backed federation.
Instruct the federated project to start syncing with other nodes in the federation.
200
OK
Success.
This rest endpoint can only be executed by the Federation Administrator. It enables a change of the synchronization schedule - that is, how often peers in the federation synchronize with other peers.
newSchedule
Required
New schedule for the federation syncing
200
OK
Success.
Instruct the federation project to stop syncing with other nodes in the federation.
200
OK
Success.
Send a single synchronization request message to the federation. This is used when a given peer/client wants to receive synchronization info from the other peers in the federation.
200
OK
Success.
Send a single synchronization request message to the federation. This is used when a given peer/client wants to receive synchronization info from the other peers in the federation.
allowExplore
Required
Whether to allow or not (true or false)
200
OK
Success.
200
OK
Success.
200
OK
Success.
The response is a String entity. If the PSR Contract is not valid, It will contains a description of the error in the PSR contract
Return error logging messages. For federated project many things can happen in the background some of which that may cause errors, invalid AWS credentials, invalid S3 bucket path for example. This rest endpoint enables the checking for various error that might occur asynchronously in the background.
200
OK
Success.
Clear the federation error log for this node.
200
OK
Success
Return synchronization logging messages.
200
OK
Success.
200
OK
Success.
TBD
This rest endpoint is provided so that one can inspect the AWS resources utilized by the federation.
aws_access_key
Required
aws_secret_key
Required
aws_region
Optional, if not passed, result will be returned for all aws region
200
OK
Success.
Encrypted
AWS :
NATS :
The returned by the rest call contains information about whether or not a project is the federation administrator. This information is present in the param
map field under the fed_is_admin
key.
Allows to Validate a PSR Contract. See the for additional information. The body of the request is a which contains a list of business rule to be enforced.
Update the PSR Contract in a federation. Only the federation admin can invoke this REST endpoint. See the for additional information. The body of the request is a which contains a list of business rule to be enforced. Please note that the PSR Contract is not validated, so care must be taken to invoke first.
see example
see example
Return information about status of the various synchronization. This is specially useful when using and you want to know if other peers in the federation have PSR contract failure and how many. Please see the data structure for details.
Please consult for an example. The response will be an encrypted JSON string. The entity key will be awsInfoEncrypted
.