culebra.trainer.topology module

Topologies for distributed trainer algorithms.

Functions

ring_destinations(origin: int, num_subtrainers: int, offset: int = 1) List[int]

Return the destinations reachable from origin.

Parameters:
  • origin (int) – The index of the origin subpopulation trainer

  • num_subtrainers (int) – The number of subpopulations

  • offset (int, optional) – Offset applied to origin, defaults to DEFAULT_RING_OFFSET

Returns:

The direct destinations from origin

Return type:

list of subpopulation trainer indexes

full_connected_destinations(origin: int, num_subtrainers: int) List[int]

Return the destinations reachable from origin.

Parameters:
  • origin (int) – The index of the origin subpopulation trainer

  • num_subtrainers (int) – The number of subpopulations

Returns:

The direct destinations from origin

Return type:

list of subpopulation trainer indexes

Attributes

DEFAULT_RING_OFFSET = 1

Default offset for the ring topology.