Compute Plan Builder¶
- class substrafl.compute_plan_builder.ComputePlanBuilder(*args, **kwargs)¶
Base compute plan builder to be inherited from SubstraFL compute plans.
All child class arguments need to be passed to it through its
kwargsin order to use them when instantiating it as a RemoteStruct in each process.
class MyComputePlan(ComputePlanBuilder): def __init__(self, custom_arg, my_custom_kwargs="value"): super().__init__(custom_arg, my_custom_kwargs=my_custom_kwargs)
- abstract build_compute_plan(train_data_nodes: Optional[List[substrafl.nodes.train_data_node.TrainDataNode]], aggregation_node: Optional[List[organizations.aggregation_node.AggregationNode]], evaluation_strategy: Optional[substrafl.evaluation_strategy.EvaluationStrategy], num_rounds: Optional[int], clean_models: Optional[bool] = True) None ¶
Build the compute plan to be executed. All arguments are optional and will be feed within the
evaluation_strategy (Optional[EvaluationStrategy]) – evaluation strategy to follow for testing models.
num_rounds (int) – Number of times to repeat the compute plan sub-graph (define in perform round). It is useful in recurring graphs, but can be ignored in other cases.
clean_models (bool) – Clean the intermediary models on the Substra platform. Set it to False if you want to download or re-use intermediary models. This causes the disk space to fill quickly so should be set to True unless needed. Defaults to True.
- Return type
- abstract load_local_state(path: pathlib.Path) Any ¶
Executed at the beginning of each step of the computation graph to load on each organization the previously saved local state.