Update to allow bazel on tensorflow_privacy to work out of the box.
PiperOrigin-RevId: 225605386
This commit is contained in:
parent
b8418b0523
commit
0af76c7b3d
6 changed files with 6 additions and 60 deletions
|
@ -1,55 +0,0 @@
|
||||||
licenses(["notice"]) # Apache 2.0
|
|
||||||
|
|
||||||
py_library(
|
|
||||||
name = "gaussian_average_query",
|
|
||||||
srcs = ["gaussian_average_query.py"],
|
|
||||||
deps = [
|
|
||||||
":private_queries",
|
|
||||||
"@org_tensorflow//tensorflow:tensorflow_py",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
py_library(
|
|
||||||
name = "dp_optimizers",
|
|
||||||
deps = [
|
|
||||||
":dp_adam",
|
|
||||||
":dp_gradient_descent",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
py_library(
|
|
||||||
name = "dp_adam",
|
|
||||||
srcs = [
|
|
||||||
"dp_adam.py",
|
|
||||||
],
|
|
||||||
deps = [
|
|
||||||
":gaussian_average_query",
|
|
||||||
"@org_tensorflow//tensorflow:tensorflow_py",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
py_library(
|
|
||||||
name = "dp_gradient_descent",
|
|
||||||
srcs = [
|
|
||||||
"dp_gradient_descent.py",
|
|
||||||
],
|
|
||||||
deps = [
|
|
||||||
":gaussian_average_query",
|
|
||||||
"@org_tensorflow//tensorflow:tensorflow_py",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
py_test(
|
|
||||||
name = "dp_optimizer_test",
|
|
||||||
srcs = ["dp_optimizer_test.py"],
|
|
||||||
deps = [
|
|
||||||
":dp_optimizers",
|
|
||||||
"@absl_py//absl/testing:parameterized",
|
|
||||||
"@org_tensorflow//tensorflow:tensorflow_py",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
py_library(
|
|
||||||
name = "private_queries",
|
|
||||||
srcs = ["private_queries.py"],
|
|
||||||
)
|
|
|
@ -20,7 +20,7 @@ from __future__ import print_function
|
||||||
|
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
|
|
||||||
import tensorflow_privacy.privacy.optimizers.gaussian_average_query as ph
|
import privacy.optimizers.gaussian_average_query as ph
|
||||||
|
|
||||||
|
|
||||||
class DPAdamOptimizer(tf.train.AdamOptimizer):
|
class DPAdamOptimizer(tf.train.AdamOptimizer):
|
||||||
|
|
|
@ -20,7 +20,7 @@ from __future__ import print_function
|
||||||
|
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
|
|
||||||
import tensorflow_privacy.privacy.optimizers.gaussian_average_query as ph
|
import privacy.optimizers.gaussian_average_query as ph
|
||||||
|
|
||||||
|
|
||||||
class DPGradientDescentOptimizer(tf.train.GradientDescentOptimizer):
|
class DPGradientDescentOptimizer(tf.train.GradientDescentOptimizer):
|
||||||
|
|
|
@ -22,8 +22,8 @@ from absl.testing import parameterized
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
|
|
||||||
from tensorflow_privacy.privacy.optimizers import dp_adam
|
from privacy.optimizers import dp_adam
|
||||||
from tensorflow_privacy.privacy.optimizers import dp_gradient_descent
|
from privacy.optimizers import dp_gradient_descent
|
||||||
|
|
||||||
|
|
||||||
def loss(val0, val1):
|
def loss(val0, val1):
|
||||||
|
|
|
@ -23,7 +23,7 @@ import collections
|
||||||
|
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
|
|
||||||
from tensorflow_privacy.privacy.optimizers import private_queries
|
from privacy.optimizers import private_queries
|
||||||
|
|
||||||
|
|
||||||
class GaussianAverageQuery(private_queries.PrivateAverageQuery):
|
class GaussianAverageQuery(private_queries.PrivateAverageQuery):
|
||||||
|
|
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
tensorflow
|
Loading…
Reference in a new issue