blob: 1712659de9bc0a3d2e3c64c3dee018c157874126 [file] [log] [blame] [edit]
#
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Private LSH clustering library
package(default_visibility = [
"//visibility:public",
])
licenses(["notice"])
py_library(
name = "clustering_algorithm",
srcs = ["clustering_algorithm.py"],
srcs_version = "PY3",
deps = [
":clustering_params",
":coreset_params",
":default_clustering_params",
":lsh_tree",
":privacy_calculator",
":private_outputs",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
"@learning_py_pip_deps//scikit_learn",
],
)
py_test(
name = "clustering_algorithm_test",
srcs = ["clustering_algorithm_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":clustering_algorithm",
":clustering_params",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
],
)
py_library(
name = "central_privacy_utils",
srcs = ["central_privacy_utils.py"],
srcs_version = "PY3",
deps = [
"@learning_py_pip_deps//numpy",
"@learning_py_pip_deps//scipy",
],
)
py_test(
name = "central_privacy_utils_test",
size = "large",
srcs = ["central_privacy_utils_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":central_privacy_utils",
":test_utils",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
"@learning_py_pip_deps//scipy",
],
)
py_library(
name = "clustering_params",
srcs = ["clustering_params.py"],
srcs_version = "PY3",
deps = [
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
],
)
py_test(
name = "clustering_params_test",
srcs = ["clustering_params_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":clustering_params",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
],
)
py_library(
name = "coreset_params",
srcs = ["coreset_params.py"],
srcs_version = "PY3",
deps = [
":clustering_params",
":privacy_calculator",
],
)
py_test(
name = "coreset_params_test",
srcs = ["coreset_params_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":clustering_params",
":coreset_params",
":test_utils",
"@learning_py_pip_deps//absl_py",
],
)
py_library(
name = "default_clustering_params",
srcs = ["default_clustering_params.py"],
srcs_version = "PY3",
deps = [
":central_privacy_utils",
":clustering_params",
":privacy_calculator",
"@learning_py_pip_deps//numpy",
],
)
py_test(
name = "default_clustering_params_test",
srcs = ["default_clustering_params_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":central_privacy_utils",
":clustering_params",
":default_clustering_params",
":test_utils",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
],
)
py_library(
name = "lsh",
srcs = ["lsh.py"],
srcs_version = "PY3",
deps = [
"@learning_py_pip_deps//numpy",
],
)
py_test(
name = "lsh_test",
srcs = ["lsh_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":lsh",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
],
)
py_library(
name = "lsh_tree",
srcs = ["lsh_tree.py"],
srcs_version = "PY3",
deps = [
":central_privacy_utils",
":clustering_params",
":coreset_params",
":lsh",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
],
)
py_test(
name = "lsh_tree_test",
size = "large",
srcs = ["lsh_tree_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":clustering_params",
":lsh",
":lsh_tree",
":test_utils",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
"@learning_py_pip_deps//scipy",
],
)
py_library(
name = "privacy_calculator",
srcs = ["privacy_calculator.py"],
srcs_version = "PY3",
deps = [
":central_privacy_utils",
":clustering_params",
"@google_dp_accounting_py//dp_accounting:dp_event",
"@google_dp_accounting_py//dp_accounting:dp_event_builder",
"@google_dp_accounting_py//dp_accounting:mechanism_calibration",
"@google_dp_accounting_py//dp_accounting/pld:accountant",
"@google_dp_accounting_py//dp_accounting/pld:common",
"@google_dp_accounting_py//dp_accounting/pld:pld_privacy_accountant",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
],
)
py_test(
name = "privacy_calculator_test",
size = "large",
srcs = ["privacy_calculator_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":clustering_params",
":privacy_calculator",
":test_utils",
"@google_dp_accounting_py//dp_accounting:dp_event",
"@google_dp_accounting_py//dp_accounting:mechanism_calibration",
"@google_dp_accounting_py//dp_accounting/pld:accountant",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
],
)
py_library(
name = "private_outputs",
srcs = ["private_outputs.py"],
srcs_version = "PY3",
deps = [
":clustering_params",
"@learning_py_pip_deps//numpy",
],
)
py_test(
name = "private_outputs_test",
srcs = ["private_outputs_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":private_outputs",
"@learning_py_pip_deps//absl_py",
"@learning_py_pip_deps//numpy",
],
)
py_library(
name = "test_utils",
testonly = 1,
srcs = ["test_utils.py"],
srcs_version = "PY3",
deps = [
":central_privacy_utils",
":clustering_params",
":coreset_params",
":privacy_calculator",
],
)