forked from 626_privacy/tensorflow_privacy
Internal change.
PiperOrigin-RevId: 459620579
This commit is contained in:
parent
24f80e8c76
commit
eaa7354f00
24 changed files with 40 additions and 40 deletions
|
@ -13,7 +13,7 @@ py_library(
|
||||||
name = "compute_dp_sgd_privacy_lib",
|
name = "compute_dp_sgd_privacy_lib",
|
||||||
srcs = ["compute_dp_sgd_privacy_lib.py"],
|
srcs = ["compute_dp_sgd_privacy_lib.py"],
|
||||||
srcs_version = "PY3",
|
srcs_version = "PY3",
|
||||||
deps = ["@com_google_differential_py//python/dp_accounting"],
|
deps = ["@com_google_differential_py//python/dp_accounting:accounting"],
|
||||||
)
|
)
|
||||||
|
|
||||||
py_binary(
|
py_binary(
|
||||||
|
@ -42,7 +42,7 @@ py_binary(
|
||||||
py_library(
|
py_library(
|
||||||
name = "compute_noise_from_budget_lib",
|
name = "compute_noise_from_budget_lib",
|
||||||
srcs = ["compute_noise_from_budget_lib.py"],
|
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(
|
py_test(
|
||||||
|
@ -61,7 +61,7 @@ py_library(
|
||||||
srcs = ["rdp_accountant.py"],
|
srcs = ["rdp_accountant.py"],
|
||||||
srcs_version = "PY3",
|
srcs_version = "PY3",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = ["@com_google_differential_py//python/dp_accounting"],
|
deps = ["@com_google_differential_py//python/dp_accounting:accounting"],
|
||||||
)
|
)
|
||||||
|
|
||||||
py_test(
|
py_test(
|
||||||
|
@ -110,6 +110,6 @@ py_test(
|
||||||
srcs_version = "PY3",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
":tree_aggregation_accountant",
|
":tree_aggregation_accountant",
|
||||||
"@com_google_differential_py//python/dp_accounting",
|
"@com_google_differential_py//python/dp_accounting:accounting",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
import math
|
import math
|
||||||
|
|
||||||
from absl import app
|
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):
|
def apply_dp_sgd_analysis(q, sigma, steps, orders, delta):
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
import math
|
import math
|
||||||
|
|
||||||
from absl import app
|
from absl import app
|
||||||
from com_google_differential_py.python.dp_accounting
|
import com_google_differential_py.python.dp_accounting
|
||||||
from scipy import optimize
|
from scipy import optimize
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ The example code would be:
|
||||||
eps, _, opt_order = rdp_accountant.get_privacy_spent(rdp, target_delta=delta)
|
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
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
from absl.testing import parameterized
|
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
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.analysis import tree_aggregation_accountant
|
from tensorflow_privacy.privacy.analysis import tree_aggregation_accountant
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ py_library(
|
||||||
deps = [
|
deps = [
|
||||||
":discrete_gaussian_utils",
|
":discrete_gaussian_utils",
|
||||||
":dp_query",
|
":dp_query",
|
||||||
"@com_google_differential_py//python/dp_accounting",
|
"@com_google_differential_py//python/dp_accounting:accounting",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ py_library(
|
||||||
deps = [
|
deps = [
|
||||||
":discrete_gaussian_utils",
|
":discrete_gaussian_utils",
|
||||||
":dp_query",
|
":dp_query",
|
||||||
"@com_google_differential_py//python/dp_accounting",
|
"@com_google_differential_py//python/dp_accounting:accounting",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ py_library(
|
||||||
deps = [
|
deps = [
|
||||||
":dp_query",
|
":dp_query",
|
||||||
":normalized_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",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
":dp_query",
|
":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",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
":dp_query",
|
":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",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
":dp_query",
|
":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",
|
":dp_query",
|
||||||
":gaussian_query",
|
":gaussian_query",
|
||||||
":quantile_estimator_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 = [
|
deps = [
|
||||||
":dp_query",
|
":dp_query",
|
||||||
":tree_aggregation",
|
":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",
|
":distributed_discrete_gaussian_query",
|
||||||
":dp_query",
|
":dp_query",
|
||||||
":gaussian_query",
|
":gaussian_query",
|
||||||
"@com_google_differential_py//python/dp_accounting",
|
"@com_google_differential_py//python/dp_accounting:accounting",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
from com_google_differential_py.python.dp_accounting
|
import com_google_differential_py.python.dp_accounting
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.dp_query import discrete_gaussian_utils
|
from tensorflow_privacy.privacy.dp_query import discrete_gaussian_utils
|
||||||
from tensorflow_privacy.privacy.dp_query import dp_query
|
from tensorflow_privacy.privacy.dp_query import dp_query
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
from com_google_differential_py.python.dp_accounting
|
import com_google_differential_py.python.dp_accounting
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.dp_query import discrete_gaussian_utils
|
from tensorflow_privacy.privacy.dp_query import discrete_gaussian_utils
|
||||||
from tensorflow_privacy.privacy.dp_query import dp_query
|
from tensorflow_privacy.privacy.dp_query import dp_query
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
from com_google_differential_py.python.dp_accounting
|
import com_google_differential_py.python.dp_accounting
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.dp_query import dp_query
|
from tensorflow_privacy.privacy.dp_query import dp_query
|
||||||
from tensorflow_privacy.privacy.dp_query import normalized_query
|
from tensorflow_privacy.privacy.dp_query import normalized_query
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
import collections
|
import collections
|
||||||
import distutils
|
import distutils
|
||||||
|
|
||||||
from com_google_differential_py.python.dp_accounting
|
import com_google_differential_py.python.dp_accounting
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.dp_query import dp_query
|
from tensorflow_privacy.privacy.dp_query import dp_query
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
from com_google_differential_py.python.dp_accounting
|
import com_google_differential_py.python.dp_accounting
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.dp_query import dp_query
|
from tensorflow_privacy.privacy.dp_query import dp_query
|
||||||
import tree
|
import tree
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
"""Implements DPQuery interface for no privacy average queries."""
|
"""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
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.dp_query import dp_query
|
from tensorflow_privacy.privacy.dp_query import dp_query
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
from com_google_differential_py.python.dp_accounting
|
import com_google_differential_py.python.dp_accounting
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.dp_query import dp_query
|
from tensorflow_privacy.privacy.dp_query import dp_query
|
||||||
from tensorflow_privacy.privacy.dp_query import gaussian_query
|
from tensorflow_privacy.privacy.dp_query import gaussian_query
|
||||||
|
|
|
@ -34,7 +34,7 @@ corresponding epsilon for a `target_delta` and `noise_multiplier` to achieve
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
from com_google_differential_py.python.dp_accounting
|
import com_google_differential_py.python.dp_accounting
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.dp_query import dp_query
|
from tensorflow_privacy.privacy.dp_query import dp_query
|
||||||
from tensorflow_privacy.privacy.dp_query import tree_aggregation
|
from tensorflow_privacy.privacy.dp_query import tree_aggregation
|
||||||
|
|
|
@ -21,7 +21,7 @@ import math
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
from com_google_differential_py.python.dp_accounting
|
import com_google_differential_py.python.dp_accounting
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.dp_query import distributed_discrete_gaussian_query
|
from tensorflow_privacy.privacy.dp_query import distributed_discrete_gaussian_query
|
||||||
from tensorflow_privacy.privacy.dp_query import dp_query
|
from tensorflow_privacy.privacy.dp_query import dp_query
|
||||||
|
|
|
@ -12,7 +12,7 @@ py_library(
|
||||||
":datasets",
|
":datasets",
|
||||||
":single_layer_softmax",
|
":single_layer_softmax",
|
||||||
"//tensorflow_privacy/privacy/optimizers:dp_optimizer_keras",
|
"//tensorflow_privacy/privacy/optimizers:dp_optimizer_keras",
|
||||||
"@com_google_differential_py//python/dp_accounting",
|
"@com_google_differential_py//python/dp_accounting:accounting",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ the algorithm of Abadi et al.: https://arxiv.org/pdf/1607.00133.pdf%20.
|
||||||
import math
|
import math
|
||||||
from typing import List, Optional, Tuple
|
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 numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.logistic_regression import datasets
|
from tensorflow_privacy.privacy.logistic_regression import datasets
|
||||||
|
|
|
@ -27,7 +27,7 @@ py_binary(
|
||||||
srcs_version = "PY3",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
"//tensorflow_privacy/privacy/optimizers:dp_optimizer",
|
"//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",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
"//tensorflow_privacy/privacy/optimizers:dp_optimizer_keras",
|
"//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",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
"//tensorflow_privacy/privacy/keras_models:dp_keras_model",
|
"//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",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
"//tensorflow_privacy/privacy/optimizers:dp_optimizer_vectorized",
|
"//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",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
"//tensorflow_privacy/privacy/optimizers:dp_optimizer",
|
"//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",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
"//tensorflow_privacy/privacy/optimizers:dp_optimizer",
|
"//tensorflow_privacy/privacy/optimizers:dp_optimizer",
|
||||||
"@com_google_differential_py//python/dp_accounting",
|
"@com_google_differential_py//python/dp_accounting:accounting",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ import os
|
||||||
from absl import app
|
from absl import app
|
||||||
from absl import flags
|
from absl import flags
|
||||||
from absl import logging
|
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 numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow import estimator as tf_estimator
|
from tensorflow import estimator as tf_estimator
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
from absl import app
|
from absl import app
|
||||||
from absl import flags
|
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 numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.optimizers.dp_optimizer import DPGradientDescentGaussianOptimizer
|
from tensorflow_privacy.privacy.optimizers.dp_optimizer import DPGradientDescentGaussianOptimizer
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
from absl import app
|
from absl import app
|
||||||
from absl import flags
|
from absl import flags
|
||||||
from absl import logging
|
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 numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.optimizers.dp_optimizer_keras import DPKerasSGDOptimizer
|
from tensorflow_privacy.privacy.optimizers.dp_optimizer_keras import DPKerasSGDOptimizer
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
from absl import app
|
from absl import app
|
||||||
from absl import flags
|
from absl import flags
|
||||||
from absl import logging
|
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 numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow_privacy.privacy.keras_models.dp_keras_model import DPSequential
|
from tensorflow_privacy.privacy.keras_models.dp_keras_model import DPSequential
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
from absl import app
|
from absl import app
|
||||||
from absl import flags
|
from absl import flags
|
||||||
from absl import logging
|
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 numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow import estimator as tf_estimator
|
from tensorflow import estimator as tf_estimator
|
||||||
|
|
|
@ -26,7 +26,7 @@ import math
|
||||||
from absl import app
|
from absl import app
|
||||||
from absl import flags
|
from absl import flags
|
||||||
from absl import logging
|
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 numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow import estimator as tf_estimator
|
from tensorflow import estimator as tf_estimator
|
||||||
|
|
Loading…
Reference in a new issue