Function opendp::measurements::make_base_gaussian
source · pub fn make_base_gaussian<D, MO>(
scale: D::Atom,
k: Option<i32>
) -> Fallible<Measurement<D, D::Carrier, D::InputMetric, MO>>where
D: GaussianDomain,
D::Atom: Float + SampleDiscreteGaussianZ2k,
(D, D::InputMetric): MetricSpace,
MO: GaussianMeasure<D>,
i32: ExactIntCast<<D::Atom as FloatBits>::Bits>,
Expand description
Make a Measurement that adds noise from the gaussian(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> | L2Distance<T> |
This function takes a noise granularity in terms of 2^k. Larger granularities are more computationally efficient, but have a looser privacy map. If k is not set, k defaults to the smallest granularity.
Arguments
scale
- Noise scale parameter for the gaussian distribution.scale
== standard_deviation.k
- The noise granularity in terms of 2^k.
Generics
D
- Domain of the data type to be privatized. Valid values areVectorDomain<AtomDomain<T>>
orAtomDomain<T>
.MO
- Output Measure. The only valid measure isZeroConcentratedDivergence<T>
.