Skip to main content

results_only

Results Only protocol.

Classes

ResultsOnly

class ResultsOnly(    *,    algorithm: Union[_ResultsOnlyCompatibleAlgoFactory_, _ResultsOnlyCompatibleModelAlgoFactory],    aggregator: Optional[_BaseAggregatorFactory] = None,    secure_aggregation: bool = False,    **kwargs: Any,):

Simply returns the results from the provided algorithm.

This protocol is the most permissive protocol and only involves one round of communication. It simply runs the algorithm on the Pod(s) and returns the results as a list (one element for every pod) unless an aggregator is specified.

Arguments

  • algorithm: The algorithm to run.
  • aggregator: The aggregator to use for updating the algorithm results across all Pods participating in the task. This argument takes priority over the secure_aggregation argument.
  • secure_aggregation: Whether to use secure aggregation. This argument is overridden by the aggregator argument.

Attributes

  • name: The name of the protocol.
  • algorithm: The algorithm to run. This must be compatible with the ResultsOnly protocol.
  • aggregator: The aggregator to use for updating the algorithm results.

Raises

  • TypeError: If the algorithm is not compatible with the protocol.

Ancestors

  • bitfount.federated.protocols.base._BaseProtocolFactory
  • abc.ABC
  • bitfount.federated.roles._RolesMixIn
  • bitfount.types._BaseSerializableObjectMixIn

Methods


def dump(self)> SerializedProtocol:

Returns the JSON-serializable representation of the protocol.

def modeller(    self, mailbox: _ModellerMailbox, **kwargs: Any,)> bitfount.federated.protocols.results_only._ModellerSide:

Returns the modeller side of the ResultsOnly protocol.

def worker(self, mailbox: _WorkerMailbox, hub: BitfountHub, **kwargs: Any)> _WorkerSide:

Returns the worker side of the ResultsOnly protocol.

Raises

  • TypeError: If the mailbox is not compatible with the aggregator.

Variables

  • static algorithm : Union[bitfount.federated.protocols.resultsonly._ResultsOnlyCompatibleAlgoFactory, bitfount.federated.protocols.results_only._ResultsOnlyCompatibleModelAlgoFactory]
  • static nested_fields : ClassVar[Dict[str, Mapping[str, Any]]]
  • static optional_nested : ClassVar[Optional[List[str]]]