PrivacyAccountant

class PrivacyAccountant(*args, **kwargs)[source]

Bases: Protocol

Protocol implemented by privacy-accounting backends.

Methods

compose(event[, count])

Compose one or more identical privacy events.

get_delta(epsilon)

Return cumulative delta at the supplied epsilon.

get_epsilon(delta)

Return cumulative epsilon at the supplied delta.

get_privacy_spent([delta])

Return cumulative privacy expenditure.

load_state_dict(state)

Restore serializable accountant state.

state_dict()

Return serializable accountant state.

would_exceed(event[, max_epsilon, count])

Return whether composing an event would exceed an epsilon limit.

Attributes

config

Return the privacy configuration.

num_releases

Return the number of composed private releases.

compose(event: GaussianPrivacyEvent, count: int = 1) None[source]

Compose one or more identical privacy events.

property config: PrivacyConfig

Return the privacy configuration.

get_delta(epsilon: float) float[source]

Return cumulative delta at the supplied epsilon.

get_epsilon(delta: float) float[source]

Return cumulative epsilon at the supplied delta.

get_privacy_spent(delta: float | None = None) PrivacySpent[source]

Return cumulative privacy expenditure.

load_state_dict(state: dict[str, object]) None[source]

Restore serializable accountant state.

property num_releases: int

Return the number of composed private releases.

state_dict() dict[str, object][source]

Return serializable accountant state.

would_exceed(event: GaussianPrivacyEvent, max_epsilon: float | None = None, count: int = 1) bool[source]

Return whether composing an event would exceed an epsilon limit.