fed_learn package
- fed_learn.client package
- Submodules
- fed_learn.client.admin module
- fed_learn.client.admin_msg_sender module
- fed_learn.client.cai module
- fed_learn.client.client_executor module
- fed_learn.client.client_model_manager module
- fed_learn.client.client_status module
- fed_learn.client.communicator module
- fed_learn.client.data_assembler module
- fed_learn.client.fed_client module
- fed_learn.client.fed_client_base module
- fed_learn.client.fed_client_lite module
- fed_learn.client.fed_privacy module
- fed_learn.client.fed_test_client module
- fed_learn.client.shell_cmd module
- fed_learn.client.sys_cmd module
- fed_learn.client.training_cmd module
- fed_learn.client.validation_cmd module
- Module contents
- fed_learn.components package
- Submodules
- fed_learn.components.data_processor module
- fed_learn.components.dict_model_reader_writer module
- fed_learn.components.metadata_generator module
- fed_learn.components.metric_manager module
- fed_learn.components.model_evaluator module
- fed_learn.components.model_reader_writer module
- fed_learn.components.model_saver module
- fed_learn.components.model_validator module
- fed_learn.components.model_visualizer module
- fed_learn.components.pt_fed_utils module
- fed_learn.components.pt_model_reader_writer module
- fed_learn.components.pt_model_saver module
- fed_learn.components.rr_client_field_processor module
- fed_learn.components.rr_client_state_processor module
- fed_learn.components.tensorboard_model_visualizer module
- fed_learn.components.tf_fed_utils module
- fed_learn.components.tf_kerasv1_model_saver module
- fed_learn.components.tf_model_reader_writer module
- fed_learn.components.tf_model_saver module
- fed_learn.components.tf_model_validator module
- Module contents
- fed_learn.handlers package
- fed_learn.protos package
- fed_learn.security package
- fed_learn.server package
- Submodules
- fed_learn.server.admin module
- fed_learn.server.client_manager module
- fed_learn.server.fed_server module
- fed_learn.server.fed_test_server module
- fed_learn.server.mmar_authz module
- fed_learn.server.model_aggregator module
- fed_learn.server.result_processor module
- fed_learn.server.round_robin_fed_server module
- fed_learn.server.sai module
- fed_learn.server.server_model_manager module
- fed_learn.server.server_status module
- fed_learn.server.shell_cmd module
- fed_learn.server.sys_cmd module
- fed_learn.server.training_cmd module
- fed_learn.server.validation_cmd module
- Module contents
-
class
Message
(topic: str, body) Bases:
object
-
get_header
(key, default=None)
-
get_ref_id
(default=None)
-
set_header
(key, value)
-
set_headers
(headers: dict)
-
set_ref_id
(msg_id)
-
-
class
MsgHeader
Bases:
object
-
REF_MSG_ID
= '_refMsgId'
-
RETURN_CODE
= '_rtnCode'
-
-
class
ReturnCode
Bases:
object
-
ERROR
= '_error'
-
OK
= '_ok'
-
-
error_reply
(err: str) → fed_learn.admin_defs.Message
-
ok_reply
(data=None) → fed_learn.admin_defs.Message
Utilities for federated learning
-
class
EventType
Bases:
object
Defines FL workflow events.
-
BEFORE_AGGREGATION
= '_beforeAggregation'
-
CLIENT_QUIT
= '_clientQuit'
-
CLIENT_REGISTER
= '_clientRegister'
-
END_AGGREGATION
= '_endAggregation'
-
END_ROUND
= '_endRound'
-
GET_MODEL
= '_getModel'
-
RECEIVE_CONTRIBUTION
= '_receiveContribution'
-
RECEIVE_MODEL
= '_receiveModel'
-
RECEIVE_VALIDATION_MODEL
= '_receiveValidationModel'
-
RECEIVE_VALIDATION_RESULTS
= '_receiveValidationResults'
-
SEND_BEST_MODEL
= '_sendBestModel'
-
SEND_MODEL
= '_sendModel'
-
SEND_VALIDATION_RESULTS
= '_sendValidationResults'
-
START_ROUND
= '_startRound'
-
SUBMIT_LOCAL_BEST_MODEL
= '_submitLocalBestModel'
-
-
exception
FLAdminException
(message) Bases:
Exception
FL Admin exceptions
-
exception
FLCommunicationException
(exception) Bases:
Exception
Base class for fed_learn communication exceptions
-
class
MessageCompressor
Bases:
object
-
compress
(model)
-
decompress
(model)
-
-
message_to_proto
(message: fed_learn.admin_defs.Message) → fed_learn.protos.admin_pb2.Message
-
proto_to_message
(proto: fed_learn.protos.admin_pb2.Message) → fed_learn.admin_defs.Message
-
class
ModelEncryptor
Bases:
<a href="#fed_learn.model_transformer.ModelTransformer">fed_learn.model_transformer.ModelTransformer</a>
-
decode
(model)
-
encode
(model)
-
-
class
ApplicationContext
Bases:
dict
-
class
FLContext
Bases:
dict
-
add_metadata
(field: str, value) add a metadata into the FLContext.
- Parameters
field – metadata field name
value – medadata field value
-
clone
()
-
get_all_metadata
()
-
get_metadata
(field)
-
get_model
()
-
get_prop
(key, default=None)
-
set_metadata
(metadata: dict)
-
set_model
(model: fed_learn.protos.federated_pb2.ModelData)
-
set_prop
(key, value)
-
set_props
(props: dict)
-
-
class
ModelTransformer
Bases:
abc.ABC
-
abstract
decode
(model)
-
abstract
encode
(model)
-
abstract
NumPy ndarray to protobuf serialization and deserialization
-
ndarray_to_proto
(nda: numpy.ndarray) → fed_learn.protos.federated_pb2.NDArray Serializes a numpy array into an NDArray protobuf message. :param nda: numpy array to serialize. :type nda: np.ndarray
- Returns
Returns an NDArray protobuf message.
-
proto_to_ndarray
(nda_proto: fed_learn.protos.federated_pb2.NDArray) → numpy.ndarray Deserializes an NDArray protobuf message into a numpy array. :param nda_proto: NDArray protobuf message to deserialize. :type nda_proto: NDArray
- Returns
Returns a numpy.ndarray.