SyncFLJob

View Source On Gitee

import com.mindspore.flclient.SyncFLJob

SyncFLJob defines the API flJobRun() for starting federated learning on the device, the API modelInference() for inference on the device, the API getModel() for obtaining the latest model on the cloud, and the API stopFLJob() for stopping federated learning training tasks.

Public Member Functions

Function

public FLClientStatus flJobRun()

public int[] modelInference()

public FLClientStatus getModel()

public void stopFLJob()

flJobRun

public FLClientStatus flJobRun()

Starts a federated learning task on the device, for specific usage, please refer to the interface introduction document.

  • Return value

    The status code of the flJobRun request.

modelInference

public int[] modelInference()

Starts an inference task on the device, for specific usage, please refer to the interface introduction document.

  • Return value

    int[] composed of the labels inferred from the input.

getModel

public FLClientStatus getModel()

Obtains the latest model on the cloud, for specific usage, please refer to the interface introduction document.

  • Return value

    The status code of the getModel request.

stopFLJob

public void stopFLJob()

The training task can be stopped by calling this interface during the federated learning training process.

When a thread calls SyncFLJob.flJobRun(), it can use another thread to call SyncFLJob.stopFLJob() to stop the federated learning training task during the federated learning training process.