Commit graph

16 commits

Author SHA1 Message Date
Yilei Yang
c14a546440 Explicitly mark Python binaries/tests with python_version = "PY2".
PiperOrigin-RevId: 260525846
2019-07-29 10:16:54 -07:00
jvmancuso
3072c86c79 find nest module based on TF version for quantile_adaptive_clip_sum_query.py 2019-07-20 10:43:48 -04:00
Galen Andrew
973a1759aa Remove unused global_state reference from initial_sample_state.
global_state is never used in any of our existing DPQueries, and we don't have any compelling use case.

PiperOrigin-RevId: 255480537
2019-06-27 14:37:49 -07:00
Galen Andrew
d5dcfec745 Remove set_denominator functions from DPQuery and make QueryWithLedger easier to use.
set_denominator was added so that the batch size doesn't need to be specified before constructing the optimizer, but it breaks the DPQuery abstraction. Now the optimizer uses a GaussianSumQuery instead of GaussianAverageQuery, and normalization by batch size is done inside the optimizer.

Also instead of creating all DPQueries with a PrivacyLedger and then wrapping with QueryWithLedger, it is now sufficient to create the queries with no ledger and QueryWithLedger will construct the ledger and pass it to all inner queries.

PiperOrigin-RevId: 251462353
2019-06-04 10:14:32 -07:00
Galen Andrew
7636945566 Cast to ensure record of NoPrivacyAverageQuery is float for compatibility with sample_state.
PiperOrigin-RevId: 249909614
2019-05-24 15:28:39 -07:00
Ilya Mironov
0efb23afcb Changing initial capacity for the ledger to smaller values. (+ restoring compatibility with Python 2)
PiperOrigin-RevId: 249292683
2019-05-21 11:38:27 -07:00
Galen Andrew
3908429796 Make DPQuery classes (almost) completely functional: the only state from the initializer that is used gets pushed into the initial_global_state.
PiperOrigin-RevId: 248424593
2019-05-15 16:06:37 -07:00
Steve Chien
17fefb3895 Remove tf.function annotation from quantile_adaptive_clip_sum_query.py that was causing import error.
PiperOrigin-RevId: 248236331
2019-05-14 16:40:55 -07:00
Galen Andrew
aaf029edad Add quantile_adaptive_clip_sum_query which dynamically adjusts the clipping norm so a specified fraction of records per sample are clipped.
PiperOrigin-RevId: 248201320
2019-05-14 13:35:29 -07:00
Galen Andrew
1d1a6e087a Extensions to DPQuery and subclasses.
1. Split DPQuery.accumulate_record function into preprocess_record and accumulate_preprocessed_record.
2. Add merge_sample_state function.
3. Add default implementations for some functions in DPQuery, and add base class SumAggregationDPQuery that implements some more. Only get_noised_result is still abstract.
4. Enforce that all states and parameters used as inputs and outputs to DPQuery functions are nested structures of tensors by replacing numbers with constants and Nones with empty tuples.

PiperOrigin-RevId: 247975791
2019-05-13 11:28:56 -07:00
Steve Chien
82852c0e71 Add comments explaining the relationship between ML terminology and DP terminology.
PiperOrigin-RevId: 246926753
2019-05-06 17:12:24 -07:00
Ilya Mironov
9cece21d92 Clean-up pass to eliminate warnings: replacing deprecated endpoints with recommended versions and annotating test sizes.
PiperOrigin-RevId: 246901723
2019-05-06 14:50:23 -07:00
Steve Chien
beb86c6e18 Update PrivacyLedger and DPOptimizer to make certain arguments optional.
PiperOrigin-RevId: 246235646
2019-05-01 18:07:32 -07:00
Nicolas Papernot
febafd830d update API calls for TF2
PiperOrigin-RevId: 245817981
2019-04-29 14:00:40 -07:00
Ilya Mironov
51e29667d9 Fixing issue #44 (imports in privacy/__init__.py). Added __init__.py to the dp_query directory for Python 2 compatibility.
PiperOrigin-RevId: 243329997
2019-04-12 14:10:48 -07:00
Galen Andrew
6231d0802d Cleanup directory structure, add top-level imports and add normalized_query.
Moved query classes from dir optimizers into new dir dp_query. Added NormalizedQuery class for queries that divide the output of another query by a constant like GaussianAverageQuery.

PiperOrigin-RevId: 240167115
2019-03-25 10:21:04 -07:00