colda.workflow.train_workflow.assistor package

Submodules

colda.workflow.train_workflow.assistor.api module

class colda.workflow.train_workflow.assistor.api.TrainAssistorMatchIdentifier

Bases: TrainBaseWorkflow

Handle train assistor match identifier stage.

Methods

train_assistor_match_identifier

classmethod train_assistor_match_identifier(train_id: str, train_id_dict: dict[str, Any]) None

Execute train assistor match identifier logic.

Parameters

train_id: str train_id_dict : dict[str, Any]

Returns

None

class colda.workflow.train_workflow.assistor.api.TrainAssistorRequest

Bases: TrainBaseWorkflow

Handle train assistor request stage.

Methods

train_assistor_request

classmethod train_assistor_request(train_id: str, train_id_dict: dict[str, Any]) None

Execute train assistor request logic.

Parameters

train_id: str train_id_dict : dict[str, Any]

Returns

None

class colda.workflow.train_workflow.assistor.api.TrainAssistorSituation

Bases: TrainBaseWorkflow

Handle train assistor situation stage.

Methods

train_assistor_situation

classmethod train_assistor_situation(train_id: str, train_id_dict: dict[str, Any]) None

Execute train assistor situation logic. 1. Assistor get training target from sponsor 2. Assistor trains the model 3. Assistor sends the model output back to sponsor

Parameters

train_id: str train_id_dict : dict[str, Any]

Returns

None

classmethod train_cooperative_model(user_id: str, train_id: str, rounds: int, sender_random_id: str, situation_content: Any) None

Function to avoid async case. When assistor gets the situation content sent by sponsor, the assistor may not complete its match identifier stage. We need to wait till the matching stage complete.

Parameters

user_id : str train_id : str rounds : int sender_random_id : str situation_content : Any

Returns

None

colda.workflow.train_workflow.assistor.match_identifier module

class colda.workflow.train_workflow.assistor.match_identifier.TrainAssistorMatchIdentifier

Bases: TrainBaseWorkflow

Handle train assistor match identifier stage.

Methods

train_assistor_match_identifier

classmethod train_assistor_match_identifier(train_id: str, train_id_dict: dict[str, Any]) None

Execute train assistor match identifier logic.

Parameters

train_id: str train_id_dict : dict[str, Any]

Returns

None

colda.workflow.train_workflow.assistor.request module

class colda.workflow.train_workflow.assistor.request.TrainAssistorRequest

Bases: TrainBaseWorkflow

Handle train assistor request stage.

Methods

train_assistor_request

classmethod train_assistor_request(train_id: str, train_id_dict: dict[str, Any]) None

Execute train assistor request logic.

Parameters

train_id: str train_id_dict : dict[str, Any]

Returns

None

colda.workflow.train_workflow.assistor.situation module

class colda.workflow.train_workflow.assistor.situation.TrainAssistorSituation

Bases: TrainBaseWorkflow

Handle train assistor situation stage.

Methods

train_assistor_situation

classmethod train_assistor_situation(train_id: str, train_id_dict: dict[str, Any]) None

Execute train assistor situation logic. 1. Assistor get training target from sponsor 2. Assistor trains the model 3. Assistor sends the model output back to sponsor

Parameters

train_id: str train_id_dict : dict[str, Any]

Returns

None

classmethod train_cooperative_model(user_id: str, train_id: str, rounds: int, sender_random_id: str, situation_content: Any) None

Function to avoid async case. When assistor gets the situation content sent by sponsor, the assistor may not complete its match identifier stage. We need to wait till the matching stage complete.

Parameters

user_id : str train_id : str rounds : int sender_random_id : str situation_content : Any

Returns

None

Module contents