Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/mechanism_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ composed or split as cleanly:
bisections, whose composite `dp_event` is a composition of exponential
mechanisms.

[dp-quantiles-src]: https://github.com/google/dpsynth/blob/main/dpsynth/local_mode/_quantiles.py
[dp-quantiles-src]: https://github.com/google/dpsynth/blob/main/dpsynth/local_mode/primitives.py

Because these heterogeneous parameters cannot be directly combined,
`configure()` accepts a single scalar `zcdp_rho` and translates it into each
Expand Down
153 changes: 0 additions & 153 deletions dpsynth/local_mode/_quantiles.py

This file was deleted.

5 changes: 2 additions & 3 deletions dpsynth/local_mode/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import dp_accounting
from dpsynth import api
from dpsynth import domain
from dpsynth.local_mode import _quantiles
from dpsynth.local_mode import primitives
from dpsynth.local_mode import vectorized_transformations as vtx
import numpy as np
Expand Down Expand Up @@ -90,7 +89,7 @@ def compute_grid_spec(
"""Returns (lower, upper, grid_size) for the quantile candidate grid."""
min_value = float(attribute.min_value)
if attribute.dtype == 'int':
m = _quantiles.jitter_factor(num_partitions)
m = primitives.jitter_factor(num_partitions)
budget = max(2, max_grid_size // m)
int_range = int(attribute.max_value - attribute.min_value + 1)
step = max(1, math.ceil(int_range / budget))
Expand Down Expand Up @@ -212,7 +211,7 @@ def from_summary(
) -> NumericalMeasurement:
"""Returns a NumericalMeasurement from pre-aggregated histogram counts."""
jitter_strategy = 'refine' if self.attribute.dtype == 'int' else 'symmetric'
indices = _quantiles.quantiles_from_histogram(
indices = primitives.quantiles_from_histogram(
rng,
counts,
epsilon_levels=np.asarray(self.epsilon_levels),
Expand Down
Loading
Loading