fl_server_api.serializers.training ¶
Classes:
| Name | Description |
|---|---|
ClientAdministrationBody | A data class representing the body of a client administration request. |
ClientAdministrationBodySchema | A schema for serializing and deserializing |
CreateTrainingRequest | A data class representing a request to create a training process. |
CreateTrainingRequestSchema | A schema for serializing and deserializing |
Classes¶
ClientAdministrationBody dataclass ¶
ClientAdministrationBodySchema ¶
Bases: Schema
flowchart TD
fl_server_api.serializers.training.ClientAdministrationBodySchema[ClientAdministrationBodySchema]
click fl_server_api.serializers.training.ClientAdministrationBodySchema href "" "fl_server_api.serializers.training.ClientAdministrationBodySchema"
A schema for serializing and deserializing ClientAdministrationBody instances.
Attributes:
| Name | Type | Description |
|---|---|---|
clients | A list of UUIDs representing the clients to be administered. |
Source code in fl_server_api/serializers/training.py
CreateTrainingRequest dataclass ¶
A data class representing a request to create a training process.
Attributes:
| Name | Type | Description |
|---|---|---|
model_id | UUID | The ID of the model to be trained. |
target_num_updates | int | The target number of updates for the training process. |
metric_names | list[str] | The names of the metrics to be used in the training process. |
aggregation_method | AggregationMethod | The method to be used for aggregating updates. Defaults to FED_AVG. |
uncertainty_method | UncertaintyMethod | The method to be used for handling uncertainty. Defaults to NONE. |
options | dict[str, Any] | Additional options for the training process. Defaults to an empty dictionary. |
clients | list[UUID] | The clients participating in the training process. Defaults to an empty list. |
Methods:
| Name | Description |
|---|---|
__init__ | |
Source code in fl_server_api/serializers/training.py
Attributes¶
aggregation_method class-attribute instance-attribute ¶
aggregation_method: AggregationMethod = field(default=FED_AVG)
Method to be used for aggregating updates. Defaults to FED_AVG.
clients class-attribute instance-attribute ¶
Clients participating in the training process. Defaults to an empty list.
metric_names instance-attribute ¶
Names of the metrics to be used in the training process.
options class-attribute instance-attribute ¶
Additional options for the training process. Defaults to an empty dictionary.
target_num_updates instance-attribute ¶
target_num_updates: int
Target number of updates for the training process.
uncertainty_method class-attribute instance-attribute ¶
uncertainty_method: UncertaintyMethod = field(default=NONE)
Method to be used for handling uncertainty. Defaults to NONE.
Functions¶
CreateTrainingRequestSchema ¶
Bases: Schema
flowchart TD
fl_server_api.serializers.training.CreateTrainingRequestSchema[CreateTrainingRequestSchema]
click fl_server_api.serializers.training.CreateTrainingRequestSchema href "" "fl_server_api.serializers.training.CreateTrainingRequestSchema"
A schema for serializing and deserializing CreateTrainingRequest instances.
Attributes:
| Name | Type | Description |
|---|---|---|
aggregation_method | Method to be used for aggregating updates. Defaults to | |
clients | Clients participating in the training process. Defaults to an empty list. | |
metric_names | Names of the metrics to be used in the training process. | |
model_id | ID of the model to be trained. | |
options | Additional options for the training process. Defaults to an empty dictionary. | |
target_num_updates | Target number of updates for the training process. | |
uncertainty_method | Method to be used for handling uncertainty. Defaults to |
Source code in fl_server_api/serializers/training.py
Attributes¶
aggregation_method class-attribute instance-attribute ¶
aggregation_method = Enum(AggregationMethod, required=True, dump_default=FED_AVG, by_value=True)
Method to be used for aggregating updates. Defaults to FED_AVG.
clients class-attribute instance-attribute ¶
Clients participating in the training process. Defaults to an empty list.
metric_names class-attribute instance-attribute ¶
Names of the metrics to be used in the training process.
options class-attribute instance-attribute ¶
Additional options for the training process. Defaults to an empty dictionary.
target_num_updates class-attribute instance-attribute ¶
Target number of updates for the training process.
uncertainty_method class-attribute instance-attribute ¶
uncertainty_method = Enum(UncertaintyMethod, required=False, dump_default=NONE, by_value=True)
Method to be used for handling uncertainty. Defaults to NONE.