Model Downloading

Examples on how to use download utils function are available in the SubstraFL examples.

substrafl.model_loading.download_aggregate_shared_state(client: Client, compute_plan_key: str, round_idx: int | None = None, rank_idx: int | None = None) Any

Download a SubstraFL aggregated object at a given state:

Parameters:
  • client (substra.Client) – Substra client where to fetch the model from.

  • compute_plan_key (str) – Compute plan key to fetch the model from.

  • round_idx (Optional[int], None) – Round of the strategy to fetch the model from. If set to None, the rank_idx will be used. (Defaults to None)

  • rank_idx (Optional[int], None) – Rank of the strategy to fetch the model from. If set to None, the last task (with the highest rank) will be used. (Defaults to None)

Returns:

The serialized aggregated instance fetch from the given state.

Return type:

Any

substrafl.model_loading.download_algo_state(client: Client, compute_plan_key: str, round_idx: int | None = None, rank_idx: int | None = None) Any

Download a SubstraFL Algo instance at a given state:

Parameters:
  • client (substra.Client) – Substra client where to fetch the model from.

  • compute_plan_key (str) – Compute plan key to fetch the model from.

  • round_idx (Optional[int], None) – Round of the strategy to fetch the model from. If set to None, the rank_idx will be used. (Defaults to None)

  • rank_idx (Optional[int], None) – Rank of the strategy to fetch the model from. If set to None, the last task (with the highest rank) will be used. (Defaults to None)

Returns:

The serialized algo instance fetch from the given state.

Return type:

Any

substrafl.model_loading.download_train_shared_state(client: Client, compute_plan_key: str, round_idx: int | None = None, rank_idx: int | None = None) Any

Download a SubstraFL shared object at a given state:

Parameters:
  • client (substra.Client) – Substra client where to fetch the model from.

  • compute_plan_key (str) – Compute plan key to fetch the model from.

  • round_idx (Optional[int], None) – Round of the strategy to fetch the model from. If set to None, the rank_idx will be used. (Defaults to None)

  • rank_idx (Optional[int], None) – Rank of the strategy to fetch the model from. If set to None, the last task (with the highest rank) will be used. (Defaults to None)

Returns:

The serialized shared instance fetch from the given state.

Return type:

Any