decent_bench.schemes#

class decent_bench.schemes.AgentActivationScheme[source]#

Bases: ABC

Scheme defining how agents go active/inactive over the course of the algorithm execution.

abstractmethod is_active(iteration: int) bool[source]#

Whether or not the agent is active.

Parameters:

iteration – current iteration of algorithm execution

class decent_bench.schemes.AlwaysActive[source]#

Bases: AgentActivationScheme

Scheme that makes the agent always active.

is_active(iteration: int) bool[source]#

Whether or not the agent is active.

Parameters:

iteration – current iteration of algorithm execution

class decent_bench.schemes.UniformActivationRate(activation_probability: float)[source]#

Bases: AgentActivationScheme

Scheme where the agent’s probability of being active is uniformly distributed.

is_active(iteration: int) bool[source]#

Whether or not the agent is active.

Parameters:

iteration – current iteration of algorithm execution

class decent_bench.schemes.CompressionScheme[source]#

Bases: ABC

Scheme defining how messages are compressed when sent over the network.

abstractmethod compress(msg: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]#

Apply compression and return a new, compressed message.

class decent_bench.schemes.NoCompression[source]#

Bases: CompressionScheme

Scheme that leaves messages uncompressed.

compress(msg: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]#

Apply compression and return a new, compressed message.

class decent_bench.schemes.Quantization(n_significant_digits: int)[source]#

Bases: CompressionScheme

Scheme that rounds each element in a message to significant_digits.

compress(msg: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]#

Apply compression and return a new, compressed message.

class decent_bench.schemes.DropScheme[source]#

Bases: ABC

Scheme defining how message drops occur over the network.

abstractmethod should_drop() bool[source]#

Whether or not to drop.

class decent_bench.schemes.NoDrops[source]#

Bases: DropScheme

Scheme that never drops messages.

should_drop() bool[source]#

Whether or not to drop.

class decent_bench.schemes.UniformDropRate(drop_rate: float)[source]#

Bases: DropScheme

Scheme that drops messages with uniform probability.

should_drop() bool[source]#

Whether or not to drop.

class decent_bench.schemes.NoiseScheme[source]#

Bases: ABC

Scheme defining how noise impacts messages.

abstractmethod make_noise(msg: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]#

Apply noise scheme without mutating the msg passed in.

class decent_bench.schemes.NoNoise[source]#

Bases: NoiseScheme

Scheme that leaves messages untouched.

make_noise(msg: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]#

Apply noise scheme without mutating the msg passed in.

class decent_bench.schemes.GaussianNoise(mean: float, sd: float)[source]#

Bases: NoiseScheme

Scheme that applies Gaussian noise - that is, noise following a normal distribution.

make_noise(msg: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]#

Apply noise scheme without mutating the msg passed in.