pub struct PrivacyBudget {
pub epsilon: f64,
pub delta: f64,
pub remaining_epsilon: f64,
}Expand description
Privacy budget for differential privacy
Fields§
§epsilon: f64Epsilon (privacy loss parameter)
delta: f64Delta (failure probability)
remaining_epsilon: f64Remaining epsilon
Implementations§
Source§impl PrivacyBudget
impl PrivacyBudget
Sourcepub fn consume(&mut self, epsilon_used: f64) -> Result<(), GradientError>
pub fn consume(&mut self, epsilon_used: f64) -> Result<(), GradientError>
Consume some privacy budget
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Check if budget is exhausted
Sourcepub fn remaining_fraction(&self) -> f64
pub fn remaining_fraction(&self) -> f64
Get the fraction of budget remaining
Trait Implementations§
Source§impl Clone for PrivacyBudget
impl Clone for PrivacyBudget
Source§fn clone(&self) -> PrivacyBudget
fn clone(&self) -> PrivacyBudget
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrivacyBudget
impl Debug for PrivacyBudget
impl Copy for PrivacyBudget
Auto Trait Implementations§
impl Freeze for PrivacyBudget
impl RefUnwindSafe for PrivacyBudget
impl Send for PrivacyBudget
impl Sync for PrivacyBudget
impl Unpin for PrivacyBudget
impl UnwindSafe for PrivacyBudget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more