Function opendp::measurements::make_gaussian
source · pub fn make_gaussian<D: GaussianDomain<MO, QI>, MO: 'static + Measure, QI: 'static>(
input_domain: D,
input_metric: D::InputMetric,
scale: MO::Distance,
k: Option<i32>
) -> Fallible<Measurement<D, D::Carrier, D::InputMetric, MO>>where
(D, D::InputMetric): MetricSpace,
Expand description
Make a Measurement that adds noise from the Gaussian(scale
) distribution to the input.
Valid inputs for input_domain
and input_metric
are:
input_domain | input type | input_metric |
---|---|---|
atom_domain(T) | T | absolute_distance(QI) |
vector_domain(atom_domain(T)) | Vec<T> | l2_distance(QI) |
§Arguments
input_domain
- Domain of the data type to be privatized.input_metric
- Metric of the data type to be privatized.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 to be privatized. Valid values areVectorDomain<AtomDomain<T>>
orAtomDomain<T>
.MO
- Output Measure. The only valid measure isZeroConcentratedDivergence<T>
.QI
- Input distance. The type of sensitivities. Can be any integer or float.