nvflare.edge.updaters.aggr module¶
- class AggrUpdater(aggregator_id: str, min_accepted=2)[source]¶
Bases:
UpdaterConstructor of AggrUpdater. AggrUpdater implements required logic by using an Aggregator.
- Parameters:
aggregator_id – component ID of the aggregator
min_accepted – minimum updates required before aggregating.
- prepare_update_for_parent(fl_ctx: FLContext) Shareable[source]¶
This is called by HUG to prepare update report to be sent to the parent.
- Parameters:
fl_ctx – FLContext object
Returns: a Shareable object for the update report; or None if no update
- process_child_update(update: ~nvflare.apis.shareable.Shareable, fl_ctx: ~nvflare.apis.fl_context.FLContext) -> (<class 'bool'>, typing.Optional[nvflare.apis.shareable.Shareable])[source]¶
This is called by HUG to process an update report from a child.
- Parameters:
update – the update report from the child
fl_ctx – FLContext object
Returns: a tuple of (whether the update is accepted, reply to the child)
- process_parent_update_reply(reply: Shareable, fl_ctx: FLContext)[source]¶
This is called by HUG to process the reply received from the parent for the update report sent to it. The reply typically contains information for how to update the current state of this Updater.
- Parameters:
reply – the reply from the parent
fl_ctx – FLContext object
Returns: None