decent_bench.benchmark_problem#

class decent_bench.benchmark_problem.BenchmarkProblem(topology_structure: Graph, optimal_x: ndarray[tuple[Any, ...], dtype[float64]], cost_functions: Sequence[CostFunction], agent_activation_schemes: Sequence[AgentActivationScheme], compression_scheme: CompressionScheme, noise_scheme: NoiseScheme, drop_scheme: DropScheme)[source]#

Bases: object

Benchmark problem to run algorithms on, defining settings such as communication constraints and topology.

Parameters:
  • topology_structure – graph defining how agents are connected

  • cost_functions – local cost functions, each one is given to one agent

  • optimal_x – solution that minimizes the sum of the cost functions, used for calculating metrics

  • agent_activation_schemes – setting for agent activation/participation, each scheme is applied to one agent

  • compression_scheme – message compression setting

  • noise_scheme – message noise setting

  • drop_scheme – message drops setting

topology_structure: Graph#
optimal_x: ndarray[tuple[Any, ...], dtype[float64]]#
cost_functions: Sequence[CostFunction]#
agent_activation_schemes: Sequence[AgentActivationScheme]#
compression_scheme: CompressionScheme#
noise_scheme: NoiseScheme#
drop_scheme: DropScheme#
decent_bench.benchmark_problem.create_regression_problem(cost_function_cls: type[LinearRegressionCost | LogisticRegressionCost], *, n_agents: int = 100, n_neighbors_per_agent: int = 3, asynchrony: bool = False, compression: bool = False, noise: bool = False, drops: bool = False) BenchmarkProblem[source]#

Create out-of-the-box regression problems.

Parameters:
  • cost_function_cls – type of cost function

  • n_agents – number of agents

  • n_neighbors_per_agent – number of neighbors per agent

  • asynchrony – if true, agents only have a 50% probability of being active/participating at any given time

  • compression – if true, messages are rounded to 4 significant digits

  • noise – if true, messages are distorted by Gaussian noise

  • drops – if true, messages have a 50% probability of being dropped