fl4health.privacy.fl_accountants module

class ClientLevelAccountant(noise_multiplier, moment_orders=None)[source]

Bases: ABC

abstract get_delta(server_updates, epsilon)[source]
Return type:

float

abstract get_epsilon(server_updates, delta)[source]
Return type:

float

class FlClientLevelAccountantFixedSamplingNoReplacement(n_total_clients, n_clients_sampled, noise_multiplier, moment_orders=None)[source]

Bases: ClientLevelAccountant

This accountant should be used when applying FL with Fixed Sampling with No Replacement and measuring client-level privacy

__init__(n_total_clients, n_clients_sampled, noise_multiplier, moment_orders=None)[source]

n_total_clients: total number of clients to be sampled from n_clients_sampled: number of clients sampled in a given round noise_multiplier: multiplier of noise std. dev. on clipping bound NOTE: The above values can be lists, where they are treated as sequences of training with the respective parameters

get_delta(server_updates, epsilon)[source]

server_updates: number of central server updates performed

Return type:

float

get_epsilon(server_updates, delta)[source]

server_updates: number of central server updates performed

Return type:

float

class FlClientLevelAccountantPoissonSampling(client_sampling_rate, noise_multiplier, moment_orders=None)[source]

Bases: ClientLevelAccountant

This accountant should be used when applying FL with Poisson client sampling and measuring client-level privacy

__init__(client_sampling_rate, noise_multiplier, moment_orders=None)[source]

client_sampling_rate: probability that each client will be included in a round noise_multiplier: multiplier of noise std. dev. on clipping bound NOTE: The above values can be lists, where they are treated as sequences of training with the respective parameters

get_delta(server_updates, epsilon)[source]

server_updates: number of central server updates performed

Return type:

float

get_epsilon(server_updates, delta)[source]

server_updates: number of central server updates performed

Return type:

float

class FlInstanceLevelAccountant(client_sampling_rate, noise_multiplier, epochs_per_round, client_batch_sizes, client_dataset_sizes, moment_orders=None)[source]

Bases: object

This accountant should be used when applying FL and measuring instance-level privacy NOTE: This class assumes that all sampling is done via Poisson sampling (client and data point level). Further it assumes that the sampling ratio of clients and noise multiplier are fixed throughout training

__init__(client_sampling_rate, noise_multiplier, epochs_per_round, client_batch_sizes, client_dataset_sizes, moment_orders=None)[source]

client_sampling_rate: probability that each client will be included in a round noise_multiplier: multiplier of noise std. dev. on clipping bound epochs_per_round: number of epochs each client will complete per server round client_batch_sizes: batch size per client, if a single value it is assumed to be constant across clients client_dataset_sizes: size of full dataset on a client, if a single value it is assumed to be constant across clients.

get_delta(server_updates, epsilon)[source]

server_updates: number of central server updates performed

Return type:

float

get_epsilon(server_updates, delta)[source]

server_updates: number of central server updates performed

Return type:

float