diff --git a/tensorflow_privacy/privacy/analysis/BUILD b/tensorflow_privacy/privacy/analysis/BUILD index 39251e8..a322fe7 100644 --- a/tensorflow_privacy/privacy/analysis/BUILD +++ b/tensorflow_privacy/privacy/analysis/BUILD @@ -13,7 +13,7 @@ py_library( name = "compute_dp_sgd_privacy_lib", srcs = ["compute_dp_sgd_privacy_lib.py"], srcs_version = "PY3", - deps = ["@com_google_differential_py//python/dp_accounting"], + deps = ["@com_google_differential_py//python/dp_accounting:accounting"], ) py_binary( @@ -42,7 +42,7 @@ py_binary( py_library( name = "compute_noise_from_budget_lib", srcs = ["compute_noise_from_budget_lib.py"], - deps = ["@com_google_differential_py//python/dp_accounting"], + deps = ["@com_google_differential_py//python/dp_accounting:accounting"], ) py_test( @@ -61,7 +61,7 @@ py_library( srcs = ["rdp_accountant.py"], srcs_version = "PY3", visibility = ["//visibility:public"], - deps = ["@com_google_differential_py//python/dp_accounting"], + deps = ["@com_google_differential_py//python/dp_accounting:accounting"], ) py_test( @@ -110,6 +110,6 @@ py_test( srcs_version = "PY3", deps = [ ":tree_aggregation_accountant", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) diff --git a/tensorflow_privacy/privacy/analysis/compute_dp_sgd_privacy_lib.py b/tensorflow_privacy/privacy/analysis/compute_dp_sgd_privacy_lib.py index 14e75a4..04866c0 100644 --- a/tensorflow_privacy/privacy/analysis/compute_dp_sgd_privacy_lib.py +++ b/tensorflow_privacy/privacy/analysis/compute_dp_sgd_privacy_lib.py @@ -17,7 +17,7 @@ import math from absl import app -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting def apply_dp_sgd_analysis(q, sigma, steps, orders, delta): diff --git a/tensorflow_privacy/privacy/analysis/compute_noise_from_budget_lib.py b/tensorflow_privacy/privacy/analysis/compute_noise_from_budget_lib.py index 4549e24..afb7f52 100644 --- a/tensorflow_privacy/privacy/analysis/compute_noise_from_budget_lib.py +++ b/tensorflow_privacy/privacy/analysis/compute_noise_from_budget_lib.py @@ -17,7 +17,7 @@ import math from absl import app -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting from scipy import optimize diff --git a/tensorflow_privacy/privacy/analysis/rdp_accountant.py b/tensorflow_privacy/privacy/analysis/rdp_accountant.py index 1344869..3f4b3c0 100644 --- a/tensorflow_privacy/privacy/analysis/rdp_accountant.py +++ b/tensorflow_privacy/privacy/analysis/rdp_accountant.py @@ -41,7 +41,7 @@ The example code would be: eps, _, opt_order = rdp_accountant.get_privacy_spent(rdp, target_delta=delta) """ -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import numpy as np diff --git a/tensorflow_privacy/privacy/analysis/tree_aggregation_accountant_test.py b/tensorflow_privacy/privacy/analysis/tree_aggregation_accountant_test.py index 3403e0b..aca0a20 100644 --- a/tensorflow_privacy/privacy/analysis/tree_aggregation_accountant_test.py +++ b/tensorflow_privacy/privacy/analysis/tree_aggregation_accountant_test.py @@ -14,7 +14,7 @@ # ============================================================================== from absl.testing import parameterized -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import tensorflow as tf from tensorflow_privacy.privacy.analysis import tree_aggregation_accountant diff --git a/tensorflow_privacy/privacy/dp_query/BUILD b/tensorflow_privacy/privacy/dp_query/BUILD index c385dde..0370fd2 100644 --- a/tensorflow_privacy/privacy/dp_query/BUILD +++ b/tensorflow_privacy/privacy/dp_query/BUILD @@ -36,7 +36,7 @@ py_library( deps = [ ":discrete_gaussian_utils", ":dp_query", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -59,7 +59,7 @@ py_library( deps = [ ":discrete_gaussian_utils", ":dp_query", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -82,7 +82,7 @@ py_library( deps = [ ":dp_query", ":normalized_query", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -103,7 +103,7 @@ py_library( srcs_version = "PY3", deps = [ ":dp_query", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -125,7 +125,7 @@ py_library( srcs_version = "PY3", deps = [ ":dp_query", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -167,7 +167,7 @@ py_library( srcs_version = "PY3", deps = [ ":dp_query", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -194,7 +194,7 @@ py_library( ":dp_query", ":gaussian_query", ":quantile_estimator_query", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -274,7 +274,7 @@ py_library( deps = [ ":dp_query", ":tree_aggregation", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -286,7 +286,7 @@ py_library( ":distributed_discrete_gaussian_query", ":dp_query", ":gaussian_query", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) diff --git a/tensorflow_privacy/privacy/dp_query/discrete_gaussian_query.py b/tensorflow_privacy/privacy/dp_query/discrete_gaussian_query.py index 6870124..65551c4 100644 --- a/tensorflow_privacy/privacy/dp_query/discrete_gaussian_query.py +++ b/tensorflow_privacy/privacy/dp_query/discrete_gaussian_query.py @@ -15,7 +15,7 @@ import collections -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import tensorflow as tf from tensorflow_privacy.privacy.dp_query import discrete_gaussian_utils from tensorflow_privacy.privacy.dp_query import dp_query diff --git a/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query.py b/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query.py index 3b4e6b5..960ff5d 100644 --- a/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query.py +++ b/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query.py @@ -15,7 +15,7 @@ import collections -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import tensorflow as tf from tensorflow_privacy.privacy.dp_query import discrete_gaussian_utils from tensorflow_privacy.privacy.dp_query import dp_query diff --git a/tensorflow_privacy/privacy/dp_query/distributed_skellam_query.py b/tensorflow_privacy/privacy/dp_query/distributed_skellam_query.py index 971499a..cdc3a49 100644 --- a/tensorflow_privacy/privacy/dp_query/distributed_skellam_query.py +++ b/tensorflow_privacy/privacy/dp_query/distributed_skellam_query.py @@ -15,7 +15,7 @@ import collections -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import tensorflow as tf from tensorflow_privacy.privacy.dp_query import dp_query from tensorflow_privacy.privacy.dp_query import normalized_query diff --git a/tensorflow_privacy/privacy/dp_query/gaussian_query.py b/tensorflow_privacy/privacy/dp_query/gaussian_query.py index 966fd72..4e81c0e 100644 --- a/tensorflow_privacy/privacy/dp_query/gaussian_query.py +++ b/tensorflow_privacy/privacy/dp_query/gaussian_query.py @@ -16,7 +16,7 @@ import collections import distutils -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import tensorflow as tf from tensorflow_privacy.privacy.dp_query import dp_query diff --git a/tensorflow_privacy/privacy/dp_query/nested_query.py b/tensorflow_privacy/privacy/dp_query/nested_query.py index 45d5df2..8595292 100644 --- a/tensorflow_privacy/privacy/dp_query/nested_query.py +++ b/tensorflow_privacy/privacy/dp_query/nested_query.py @@ -15,7 +15,7 @@ import collections -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import tensorflow as tf from tensorflow_privacy.privacy.dp_query import dp_query import tree diff --git a/tensorflow_privacy/privacy/dp_query/no_privacy_query.py b/tensorflow_privacy/privacy/dp_query/no_privacy_query.py index 189926d..ccf0cf3 100644 --- a/tensorflow_privacy/privacy/dp_query/no_privacy_query.py +++ b/tensorflow_privacy/privacy/dp_query/no_privacy_query.py @@ -13,7 +13,7 @@ # limitations under the License. """Implements DPQuery interface for no privacy average queries.""" -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import tensorflow as tf from tensorflow_privacy.privacy.dp_query import dp_query diff --git a/tensorflow_privacy/privacy/dp_query/quantile_adaptive_clip_sum_query.py b/tensorflow_privacy/privacy/dp_query/quantile_adaptive_clip_sum_query.py index 0bf5569..5657c1b 100644 --- a/tensorflow_privacy/privacy/dp_query/quantile_adaptive_clip_sum_query.py +++ b/tensorflow_privacy/privacy/dp_query/quantile_adaptive_clip_sum_query.py @@ -15,7 +15,7 @@ import collections -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import tensorflow as tf from tensorflow_privacy.privacy.dp_query import dp_query from tensorflow_privacy.privacy.dp_query import gaussian_query diff --git a/tensorflow_privacy/privacy/dp_query/tree_aggregation_query.py b/tensorflow_privacy/privacy/dp_query/tree_aggregation_query.py index 671339a..85ebf93 100644 --- a/tensorflow_privacy/privacy/dp_query/tree_aggregation_query.py +++ b/tensorflow_privacy/privacy/dp_query/tree_aggregation_query.py @@ -34,7 +34,7 @@ corresponding epsilon for a `target_delta` and `noise_multiplier` to achieve """ import attr -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import tensorflow as tf from tensorflow_privacy.privacy.dp_query import dp_query from tensorflow_privacy.privacy.dp_query import tree_aggregation diff --git a/tensorflow_privacy/privacy/dp_query/tree_range_query.py b/tensorflow_privacy/privacy/dp_query/tree_range_query.py index de0e1b2..1d92471 100644 --- a/tensorflow_privacy/privacy/dp_query/tree_range_query.py +++ b/tensorflow_privacy/privacy/dp_query/tree_range_query.py @@ -21,7 +21,7 @@ import math from typing import Optional import attr -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import tensorflow as tf from tensorflow_privacy.privacy.dp_query import distributed_discrete_gaussian_query from tensorflow_privacy.privacy.dp_query import dp_query diff --git a/tensorflow_privacy/privacy/logistic_regression/BUILD b/tensorflow_privacy/privacy/logistic_regression/BUILD index 18f59aa..b9c2dd8 100644 --- a/tensorflow_privacy/privacy/logistic_regression/BUILD +++ b/tensorflow_privacy/privacy/logistic_regression/BUILD @@ -12,7 +12,7 @@ py_library( ":datasets", ":single_layer_softmax", "//tensorflow_privacy/privacy/optimizers:dp_optimizer_keras", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) diff --git a/tensorflow_privacy/privacy/logistic_regression/multinomial_logistic.py b/tensorflow_privacy/privacy/logistic_regression/multinomial_logistic.py index 4d93f38..bc4d9e0 100644 --- a/tensorflow_privacy/privacy/logistic_regression/multinomial_logistic.py +++ b/tensorflow_privacy/privacy/logistic_regression/multinomial_logistic.py @@ -28,7 +28,7 @@ the algorithm of Abadi et al.: https://arxiv.org/pdf/1607.00133.pdf%20. import math from typing import List, Optional, Tuple -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import numpy as np import tensorflow as tf from tensorflow_privacy.privacy.logistic_regression import datasets diff --git a/tutorials/BUILD b/tutorials/BUILD index 0a8f487..592ff2f 100644 --- a/tutorials/BUILD +++ b/tutorials/BUILD @@ -27,7 +27,7 @@ py_binary( srcs_version = "PY3", deps = [ "//tensorflow_privacy/privacy/optimizers:dp_optimizer", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -38,7 +38,7 @@ py_binary( srcs_version = "PY3", deps = [ "//tensorflow_privacy/privacy/optimizers:dp_optimizer_keras", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -49,7 +49,7 @@ py_binary( srcs_version = "PY3", deps = [ "//tensorflow_privacy/privacy/keras_models:dp_keras_model", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -60,7 +60,7 @@ py_binary( srcs_version = "PY3", deps = [ "//tensorflow_privacy/privacy/optimizers:dp_optimizer_vectorized", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -83,7 +83,7 @@ py_binary( srcs_version = "PY3", deps = [ "//tensorflow_privacy/privacy/optimizers:dp_optimizer", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) @@ -94,7 +94,7 @@ py_binary( srcs_version = "PY3", deps = [ "//tensorflow_privacy/privacy/optimizers:dp_optimizer", - "@com_google_differential_py//python/dp_accounting", + "@com_google_differential_py//python/dp_accounting:accounting", ], ) diff --git a/tutorials/lm_dpsgd_tutorial.py b/tutorials/lm_dpsgd_tutorial.py index ed01ca5..15c99d0 100644 --- a/tutorials/lm_dpsgd_tutorial.py +++ b/tutorials/lm_dpsgd_tutorial.py @@ -35,7 +35,7 @@ import os from absl import app from absl import flags from absl import logging -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import numpy as np import tensorflow as tf from tensorflow import estimator as tf_estimator diff --git a/tutorials/mnist_dpsgd_tutorial_eager.py b/tutorials/mnist_dpsgd_tutorial_eager.py index 0e105a6..7a89ad3 100644 --- a/tutorials/mnist_dpsgd_tutorial_eager.py +++ b/tutorials/mnist_dpsgd_tutorial_eager.py @@ -15,7 +15,7 @@ from absl import app from absl import flags -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import numpy as np import tensorflow as tf from tensorflow_privacy.privacy.optimizers.dp_optimizer import DPGradientDescentGaussianOptimizer diff --git a/tutorials/mnist_dpsgd_tutorial_keras.py b/tutorials/mnist_dpsgd_tutorial_keras.py index 5265ee4..248baa2 100644 --- a/tutorials/mnist_dpsgd_tutorial_keras.py +++ b/tutorials/mnist_dpsgd_tutorial_keras.py @@ -16,7 +16,7 @@ from absl import app from absl import flags from absl import logging -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import numpy as np import tensorflow as tf from tensorflow_privacy.privacy.optimizers.dp_optimizer_keras import DPKerasSGDOptimizer diff --git a/tutorials/mnist_dpsgd_tutorial_keras_model.py b/tutorials/mnist_dpsgd_tutorial_keras_model.py index 497e7a2..180c8d3 100644 --- a/tutorials/mnist_dpsgd_tutorial_keras_model.py +++ b/tutorials/mnist_dpsgd_tutorial_keras_model.py @@ -16,7 +16,7 @@ from absl import app from absl import flags from absl import logging -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import numpy as np import tensorflow as tf from tensorflow_privacy.privacy.keras_models.dp_keras_model import DPSequential diff --git a/tutorials/mnist_dpsgd_tutorial_vectorized.py b/tutorials/mnist_dpsgd_tutorial_vectorized.py index 9accb4f..4412e94 100644 --- a/tutorials/mnist_dpsgd_tutorial_vectorized.py +++ b/tutorials/mnist_dpsgd_tutorial_vectorized.py @@ -16,7 +16,7 @@ from absl import app from absl import flags from absl import logging -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import numpy as np import tensorflow as tf from tensorflow import estimator as tf_estimator diff --git a/tutorials/mnist_lr_tutorial.py b/tutorials/mnist_lr_tutorial.py index ee8e346..c1bd6bc 100644 --- a/tutorials/mnist_lr_tutorial.py +++ b/tutorials/mnist_lr_tutorial.py @@ -26,7 +26,7 @@ import math from absl import app from absl import flags from absl import logging -from com_google_differential_py.python.dp_accounting +import com_google_differential_py.python.dp_accounting import numpy as np import tensorflow as tf from tensorflow import estimator as tf_estimator