forked from 626_privacy/tensorflow_privacy
Fix dependencies required by privacy_tests
.
Update `distutils` to `packaging`. PiperOrigin-RevId: 496713867
This commit is contained in:
parent
2040f08f0d
commit
f99a74c7a4
4 changed files with 11 additions and 12 deletions
|
@ -24,12 +24,15 @@ absl-py>=1.0,==1.*
|
||||||
attrs~=21.4
|
attrs~=21.4
|
||||||
dm-tree==0.1.7
|
dm-tree==0.1.7
|
||||||
dp-accounting==0.3.0
|
dp-accounting==0.3.0
|
||||||
|
immutabledict~=2.2
|
||||||
matplotlib~=3.3
|
matplotlib~=3.3
|
||||||
mpmath~=1.2
|
mpmath~=1.2
|
||||||
numpy~=1.21
|
numpy~=1.21
|
||||||
|
packaging~=22.0
|
||||||
pandas~=1.4
|
pandas~=1.4
|
||||||
scikit-learn>=1.0,==1.*
|
scikit-learn>=1.0,==1.*
|
||||||
scipy~=1.7
|
scipy~=1.7
|
||||||
|
statsmodels~=0.13
|
||||||
tensorflow-datasets~=4.5
|
tensorflow-datasets~=4.5
|
||||||
tensorflow-estimator~=2.4
|
tensorflow-estimator~=2.4
|
||||||
tensorflow-probability==0.15.0
|
tensorflow-probability==0.15.0
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -31,11 +31,15 @@ setup(
|
||||||
'attrs~=21.4',
|
'attrs~=21.4',
|
||||||
'dm-tree==0.1.7',
|
'dm-tree==0.1.7',
|
||||||
'dp-accounting==0.3.0',
|
'dp-accounting==0.3.0',
|
||||||
|
'immutabledict~=2.2',
|
||||||
'matplotlib~=3.3',
|
'matplotlib~=3.3',
|
||||||
'numpy~=1.21',
|
'numpy~=1.21',
|
||||||
|
'packaging~=22.0',
|
||||||
'pandas~=1.4',
|
'pandas~=1.4',
|
||||||
|
'parameterized~=0.8',
|
||||||
'scikit-learn>=1.0,==1.*',
|
'scikit-learn>=1.0,==1.*',
|
||||||
'scipy~=1.7',
|
'scipy~=1.7',
|
||||||
|
'statsmodels~=0.13',
|
||||||
'tensorflow-datasets~=4.5',
|
'tensorflow-datasets~=4.5',
|
||||||
'tensorflow-estimator~=2.4',
|
'tensorflow-estimator~=2.4',
|
||||||
'tensorflow-probability==0.15.0',
|
'tensorflow-probability==0.15.0',
|
||||||
|
|
|
@ -14,9 +14,8 @@
|
||||||
"""Implements DPQuery interface for Gaussian sum queries."""
|
"""Implements DPQuery interface for Gaussian sum queries."""
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import distutils
|
|
||||||
|
|
||||||
import dp_accounting
|
import dp_accounting
|
||||||
|
import packaging
|
||||||
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
|
||||||
|
|
||||||
|
@ -79,8 +78,8 @@ class GaussianSumQuery(dp_query.SumAggregationDPQuery):
|
||||||
|
|
||||||
def get_noised_result(self, sample_state, global_state):
|
def get_noised_result(self, sample_state, global_state):
|
||||||
"""Implements `tensorflow_privacy.DPQuery.get_noised_result`."""
|
"""Implements `tensorflow_privacy.DPQuery.get_noised_result`."""
|
||||||
if distutils.version.LooseVersion(
|
if packaging.version.Version(
|
||||||
tf.__version__) < distutils.version.LooseVersion('2.0.0'):
|
tf.__version__) < packaging.version.Version('2.0.0'):
|
||||||
|
|
||||||
def add_noise(v):
|
def add_noise(v):
|
||||||
return v + tf.random.normal(
|
return v + tf.random.normal(
|
||||||
|
|
|
@ -15,10 +15,7 @@ py_test(
|
||||||
srcs = ["utils_test.py"],
|
srcs = ["utils_test.py"],
|
||||||
python_version = "PY3",
|
python_version = "PY3",
|
||||||
srcs_version = "PY3",
|
srcs_version = "PY3",
|
||||||
deps = [
|
deps = [":utils"],
|
||||||
":utils",
|
|
||||||
"//third_party/py/parameterized",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
py_test(
|
py_test(
|
||||||
|
@ -36,8 +33,4 @@ py_library(
|
||||||
py_library(
|
py_library(
|
||||||
name = "epsilon_lower_bound",
|
name = "epsilon_lower_bound",
|
||||||
srcs = ["epsilon_lower_bound.py"],
|
srcs = ["epsilon_lower_bound.py"],
|
||||||
deps = [
|
|
||||||
"//third_party/py/immutabledict",
|
|
||||||
"//third_party/py/statsmodels",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue