Function opendp::measurements::make_base_discrete_laplace
source · pub fn make_base_discrete_laplace<D, QO>(
scale: QO
) -> Fallible<Measurement<D, D::Carrier, D::InputMetric, MaxDivergence<QO>>>where
D: DiscreteLaplaceDomain,
D::Atom: Integer + SampleDiscreteLaplaceLinear<QO>,
(D, D::InputMetric): MetricSpace,
QO: Float + InfCast<D::Atom>,
Rational: TryFrom<QO>,
Integer: From<D::Atom> + SaturatingCast<D::Atom>,
Expand description
Make a Measurement that adds noise from the discrete_laplace(scale
) distribution to the input.
Set D
to change the input data type and input metric:
D | input type | D::InputMetric |
---|---|---|
AtomDomain<T> (default) | T | AbsoluteDistance<T> |
VectorDomain<AtomDomain<T>> | Vec<T> | L1Distance<T> |
This uses make_base_discrete_laplace_cks20
if scale is greater than 10, otherwise it uses make_base_discrete_laplace_linear
.
Citations
- GRS12 Universally Utility-Maximizing Privacy Mechanisms
- CKS20 The Discrete Gaussian for Differential Privacy
Arguments
scale
- Noise scale parameter for the laplace distribution.scale
== sqrt(2) * standard_deviation.
Generics
D
- Domain of the data type to be privatized. Valid values areVectorDomain<AtomDomain<T>>
orAtomDomain<T>
QO
- Data type of the output distance and scale.f32
orf64
.