openfl.component.director.experiment.Experiment#
- class openfl.component.director.experiment.Experiment(*, name, archive_path, collaborators, sender, init_tensor_dict, plan_path='plan/plan.yaml', users=None)[source]#
Bases:
objectExperiment class.
- Parameters:
name (str)
archive_path (Path | str)
collaborators (List[str])
sender (str)
init_tensor_dict (dict)
plan_path (Path | str)
users (Iterable[str])
- name#
The name of the experiment.
- Type:
str
- archive_path#
The path to the experiment archive.
- Type:
Union[Path, str]
- collaborators#
The list of collaborators.
- Type:
List[str]
- sender#
The name of the sender.
- Type:
str
- init_tensor_dict#
The initial tensor dictionary.
- Type:
dict
- plan_path#
The path to the plan.
- Type:
Union[Path, str]
- users#
The list of users.
- Type:
Iterable[str]
- status#
The status of the experiment.
- Type:
str
- aggregator#
The aggregator object.
- Type:
object
- run_aggregator_atask#
The run aggregator async task object.
- Type:
object
- __init__(*, name, archive_path, collaborators, sender, init_tensor_dict, plan_path='plan/plan.yaml', users=None)[source]#
Initialize an experiment object.
- Parameters:
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], optional) – The path to the plan. Defaults to ‘plan/plan.yaml’.
users (Iterable[str], optional) – The list of users. Defaults to None.
- Return type:
None
Methods
__init__(*, name, archive_path, ...[, ...])Initialize an experiment object.
review_experiment(review_plan_callback)Get plan approve in console.
start(*[, tls, root_certificate, ...])Run experiment.
- async review_experiment(review_plan_callback)[source]#
Get plan approve in console.
- Parameters:
review_plan_callback (Callable) – A callback function for reviewing the plan.
- Returns:
True if the plan was approved, False otherwise.
- Return type:
bool
- async start(*, tls=True, root_certificate=None, private_key=None, certificate=None, install_requirements=False)[source]#
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.