Skip to content

Commit 7229086

Browse files
SHA upgrade (#309)
* sha bump * added bounds in carrots demo
1 parent 7062da2 commit 7229086

File tree

8 files changed

+20
-15
lines changed

8 files changed

+20
-15
lines changed

.github/workflows/pypipublish_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
run: |
1818
git submodule update --init --recursive
1919
cd third_party/differential-privacy
20-
git checkout 613c69ec6a7058c821b52ae6ad0ae04ad28270f1
20+
git checkout 2b320f8c03ba97215e3de7f7782eb5b8fd0b2354
2121
cd -
2222
rm -rf third_party/differential-privacy/java
2323
rm -rf third_party/differential-privacy/examples/java

.github/workflows/pypipublish_osx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
run: |
1818
git submodule update --init --recursive
1919
cd third_party/differential-privacy
20-
git checkout 613c69ec6a7058c821b52ae6ad0ae04ad28270f1
20+
git checkout 2b320f8c03ba97215e3de7f7782eb5b8fd0b2354
2121
cd -
2222
rm -rf third_party/differential-privacy/java
2323
rm -rf third_party/differential-privacy/examples/java

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ARG BAZEL_DOWNLOAD_URL=https://github.com/bazelbuild/bazel/releases/download
1212
ENV HOME=/root
1313
ENV PROJECT_DIR="${HOME}/PyDP"
1414
ENV PATH="/root/bin:${PATH}"
15-
ENV DP_SHA="613c69ec6a7058c821b52ae6ad0ae04ad28270f1"
15+
ENV DP_SHA="2b320f8c03ba97215e3de7f7782eb5b8fd0b2354"
1616

1717
# Define working directory
1818
WORKDIR ${HOME}

examples/carrots_demo/carrots.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ def privacy_budget(self) -> float:
5353

5454
# Function to return the DP sum of all carrots eaten.
5555
def private_sum(self, privacy_budget: float) -> float:
56-
x = BoundedSum(privacy_budget, dtype="float")
56+
x = BoundedSum(privacy_budget, 0, 100, dtype="float")
5757
return x.quick_result(list(self._df["carrots_eaten"]))
5858

5959
# Function to return the DP mean of all carrots eaten.
6060
def private_mean(self, privacy_budget: float) -> float:
61-
x = BoundedMean(privacy_budget, dtype="float")
61+
x = BoundedMean(privacy_budget, 0, 100, dtype="float")
6262
return x.quick_result(list(self._df["carrots_eaten"]))
6363

6464
# Function to return the DP count of the number of animals who ate more than "limit" carrots.
@@ -73,7 +73,7 @@ def private_count_above(
7373
# Function to return the DP maximum of the number of carrots eaten by any one animal.
7474
def private_max(self, privacy_budget: float) -> Union[int, float]:
7575
# 0 and 150 are the upper and lower limits for the search bound.
76-
x = Max(privacy_budget, 0, 150, dtype="int")
76+
x = Max(privacy_budget, 0, 100, dtype="int")
7777
return x.quick_result(list(self._df["carrots_eaten"]))
7878

7979

examples/carrots_demo/carrots_demo.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
"source": [
266266
"# calculates mean applying differential privacy\n",
267267
"def private_mean(privacy_budget: float) -> float:\n",
268-
" x = BoundedMean(privacy_budget)\n",
268+
" x = BoundedMean(privacy_budget, 1, 100)\n",
269269
" return x.quick_result(list(df[\"carrots_eaten\"]))"
270270
]
271271
},
@@ -433,7 +433,7 @@
433433
"# Function to return the maximum of the number of carrots eaten by any one animal appyling differential privacy.\n",
434434
"def private_max(privacy_budget: float) -> int:\n",
435435
" # 0 and 150 are the upper and lower limits for the search bound.\n",
436-
" x = Max(privacy_budget, 0, 150, dtype=\"int\")\n",
436+
" x = Max(privacy_budget, 0, 100, dtype=\"int\")\n",
437437
" return x.quick_result(list(df[\"carrots_eaten\"]))"
438438
]
439439
},
@@ -506,7 +506,7 @@
506506
"source": [
507507
"# Function to calculate sum of carrots eaten applying differential privacy.\n",
508508
"def private_sum(privacy_budget: float) -> int:\n",
509-
" x = BoundedSum(privacy_budget, dtype=\"float\")\n",
509+
" x = BoundedSum(privacy_budget,1,100, dtype=\"float\")\n",
510510
" return x.quick_result(list(df[\"carrots_eaten\"]))"
511511
]
512512
},
@@ -577,4 +577,4 @@
577577
},
578578
"nbformat": 4,
579579
"nbformat_minor": 4
580-
}
580+
}

prereqs_linux.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,13 @@ git submodule update --init --recursive
5959

6060

6161
# checkout out to particular commit
62-
cd third_party/differential-privacy && git checkout 613c69ec6a7058c821b52ae6ad0ae04ad28270f1 && \
62+
cd third_party/differential-privacy && git checkout 2b320f8c03ba97215e3de7f7782eb5b8fd0b2354 && \
6363
cd -
6464
# renaming workspace.bazel to workspace
6565
mv third_party/differential-privacy/cc/WORKSPACE.bazel third_party/differential-privacy/cc/WORKSPACE
6666

6767
# Removing the java part
6868
rm -rf third_party/differential-privacy/java third_party/differential-privacy/examples/java
69+
70+
# Removing the Go part
71+
rm -rf third_party/differential-privacy/go third_party/differential-privacy/examples/go

prereqs_mac.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ fi
4949
git submodule update --init --recursive
5050

5151
# checkout out to particular commit
52-
cd third_party/differential-privacy && git checkout 613c69ec6a7058c821b52ae6ad0ae04ad28270f1
53-
52+
cd third_party/differential-privacy && git checkout 2b320f8c03ba97215e3de7f7782eb5b8fd0b2354 && \
5453
cd -
5554
# renaming workspace.bazel to workspace
5655
mv third_party/differential-privacy/cc/WORKSPACE.bazel third_party/differential-privacy/cc/WORKSPACE
5756

58-
# Removing the Java part
57+
# Removing the java part
5958
rm -rf third_party/differential-privacy/java third_party/differential-privacy/examples/java
59+
60+
# Removing the Go part
61+
rm -rf third_party/differential-privacy/go third_party/differential-privacy/examples/go

third_party/differential-privacy

0 commit comments

Comments
 (0)