openfl.component.director.experiment.Experiment

class openfl.component.director.experiment.Experiment(*, name: str, archive_path: Path | str, collaborators: List[str], sender: str, init_tensor_dict: dict, plan_path: Path | str = 'plan/plan.yaml', users: Iterable[str] | None = None)

Bases: object

Experiment class.

Class Attributes:
  • name (str) – The name of the experiment.

  • archive_path (Union[Path, str]) – The path to the experiment archive.

  • collaborators (List[str]) – The list of collaborators.

  • sender (str) – The name of the sender.

  • init_tensor_dict (dict) – The initial tensor dictionary.

  • plan_path (Union[Path, str]) – The path to the plan.

  • users (Iterable[str]) – The list of users.

  • status (str) – The status of the experiment.

  • aggregator (object) – The aggregator object.

  • run_aggregator_atask (object) – The run aggregator async task object.

Methods

review_experiment

Get plan approve in console.

start

Run experiment.

async review_experiment(review_plan_callback: Callable) bool

Get plan approve in console.

Parameters:

review_plan_callback (Callable) – A callback function for reviewing the plan.

Returns:

bool – True if the plan was approved, False otherwise.

async start(*, tls: bool = True, root_certificate: Path | str | None = None, private_key: Path | str | None = None, certificate: Path | str | None = None, install_requirements: bool = False)

Run experiment.

Parameters:
  • tls (bool, optional) – A flag indicating if TLS should be used for connections. Defaults to True.

  • root_certificate (Union[Path, str], optional) – The path to the root certificate for TLS. Defaults to None.

  • private_key (Union[Path, str], optional) – The path to the private key for TLS. Defaults to None.

  • certificate (Union[Path, str], optional) – The path to the certificate for TLS. Defaults to None.

  • install_requirements (bool, optional) – A flag indicating if the requirements should be installed. Defaults to False.