Documentation ¶
Index ¶
Constants ¶
const ( /* Define Task Status stored in Contract */ TaskConfirming = "Confirming" // waiting for Executors to confirm TaskReady = "Ready" // has been confirmed by all Executors, and ready to start TaskToProcess = "ToProcess" // has started, and waiting to be precessed TaskProcessing = "Processing" // under process, that's during training or predicting TaskFinished = "Finished" // task finished TaskFailed = "Failed" // task failed TaskRejected = "Rejected" // task rejected by one of the Executors /* Define Task Type stored in Contract */ TaskTypeTrain = "train" // training task TaskTypePredict = "predict" // prediction task /* Define Algorithms stored in Contract */ AlgorithmVLine = "linear-vl" // linear regression with multiple variables in vertical federated learning AlgorithmVLog = "logistic-vl" // logistic regression with multiple variables in vertical federated learning AlgorithmVDnn = "dnn-paddlefl-vl" // dnn implemented using paddlefl /* Define Regularization stored in Contract */ RegModeL1 = "l1" // L1-norm RegModeL2 = "l2" // L2-norm /* Define the maximum number of task list query */ TaskListMaxNum = 100 )
Variables ¶
var RegModeListName = map[string]pbCom.RegMode{ RegModeL1: pbCom.RegMode_Reg_Lasso, RegModeL2: pbCom.RegMode_Reg_Ridge, }
RegModeListName the mapping of train regMode name and value
var RegModeListValue = map[pbCom.RegMode]string{ pbCom.RegMode_Reg_Lasso: RegModeL1, pbCom.RegMode_Reg_Ridge: RegModeL2, }
RegModeListValue the mapping of train regMode value and name
var TaskTypeListName = map[string]pbCom.TaskType{ TaskTypeTrain: pbCom.TaskType_LEARN, TaskTypePredict: pbCom.TaskType_PREDICT, }
TaskTypeListName the mapping of train task type name and value key is the task type name of the training task or prediction task
var TaskTypeListValue = map[pbCom.TaskType]string{ pbCom.TaskType_LEARN: TaskTypeTrain, pbCom.TaskType_PREDICT: TaskTypePredict, }
TaskTypeListValue the mapping of train task type value and name key is the int value of the training task or prediction task
var VlAlgorithmListName = map[string]pbCom.Algorithm{ AlgorithmVLine: pbCom.Algorithm_LINEAR_REGRESSION_VL, AlgorithmVLog: pbCom.Algorithm_LOGIC_REGRESSION_VL, AlgorithmVDnn: pbCom.Algorithm_DNN_PADDLEFL_VL, }
VlAlgorithmListName the mapping of vertical algorithm name and value
var VlAlgorithmListValue = map[pbCom.Algorithm]string{ pbCom.Algorithm_LINEAR_REGRESSION_VL: AlgorithmVLine, pbCom.Algorithm_LOGIC_REGRESSION_VL: AlgorithmVLog, pbCom.Algorithm_DNN_PADDLEFL_VL: AlgorithmVDnn, }
VlAlgorithmListValue the mapping of vertical algorithm value and name key is the int value of the algorithm
Functions ¶
This section is empty.
Types ¶
type AddNodeOptions ¶
type AddNodeOptions struct { Node ExecutorNode `json:"node"` Signature []byte `json:"signature"` }
AddNodeOptions contains parameters for adding node of Executor
type ExecutorNode ¶
type ExecutorNode struct { ID []byte `json:"id"` Name string `json:"name"` Address string `json:"address"` // local grpc host HttpAddress string `json:"httpAddress"` // local http host PaddleFLAddress string `json:"paddleFLAddress"` PaddleFLRole int `json:"paddleFLRole"` RegTime int64 `json:"regTime"` // node registering time }
ExecutorNode has access to samples with which to train models or to predict,
and starts task that multi parties execute synchronically
type ExecutorNodes ¶
type ExecutorNodes []ExecutorNode
type FLInfo ¶
type FLInfo struct { FileType string `json:"fileType"` // file type, only supports "csv" Features string `json:"features"` // feature list TotalRows int64 `json:"totalRows"` // total number of samples }
FLInfo used to parse the content contained in the extra field of the file on the chain, only files that can be parsed can be used for task training or prediction
type FLTaskConfirmOptions ¶
type FLTaskConfirmOptions struct { Pubkey []byte `json:"pubkey"` // one of the task executor's public key TaskID string `json:"taskID"` RejectReason string `json:"rejectReason"` // reason of the rejected task CurrentTime int64 `json:"currentTime"` // time when confirming task Signature []byte `json:"signature"` // executor's signature }
FLTaskConfirmOptions contains parameters for confirming task
type FLTaskExeStatusOptions ¶
type FLTaskExeStatusOptions struct { Executor []byte `json:"executor"` TaskID string `json:"taskID"` CurrentTime int64 `json:"currentTime"` // task execute start time or finish time Signature []byte `json:"signature"` ErrMessage string `json:"errMessage"` // for failed task Result string `json:"result"` // for finished task }
FLTaskExeStatusOptions contains parameters for updating executing task
type ListFLTaskOptions ¶
type ListFLTaskOptions struct { PubKey []byte `json:"pubKey"` // requester's public key ExecPubKey []byte `json:"exePubKey"` // executor's public key Status string `json:"status"` // task status TimeStart int64 `json:"timeStart"` // task publish time period, only task published after TimeStart and before TimeEnd will be listed TimeEnd int64 `json:"timeEnd"` Limit int64 `json:"limit"` // limit number of tasks in list request, default 'all' }
ListFLTaskOptions contains parameters for listing tasks support listing tasks a requester published or tasks an executor involved
type PublishFLTaskOptions ¶
type PublishFLTaskOptions struct { FLTask FLTask `json:"fLTask"` Signature []byte `json:"signature"` }
PublishFLTaskOptions contains parameters for publishing tasks
type StartFLTaskOptions ¶
type StartFLTaskOptions struct { TaskID string `json:"taskID"` Signature []byte `json:"signature"` }
StartFLTaskOptions contains parameters for the requester to start tasks