@@ -27,25 +27,23 @@ paper: https://arxiv.org/abs/1607.00133
27
27
28
28
Note: r0.11 might experience some problems
29
29
30
- 2 . Bazel 0.3.1
30
+ 2 . Bazel 0.3.1 (< em >Optional</ em >)
31
31
32
- 3 . Download MNIST data
33
-
34
- TODO(xpan): Complete the link:
35
- [ train] ( http://download.tensorflow.org/models/ )
36
- [ test] ( http://download.tensorflow.org/models/ )
37
-
38
- Alternatively, download the tfrecord format MNIST from:
39
- https://github.com/panyx0718/models/tree/master/slim
32
+ 3 . Download MNIST data (tfrecord format) <br >
33
+ ``` shell
34
+ cd models/research/slim
35
+ DATA_DIR=/tmp/mnist/
36
+ mkdir /tmp/mnist
37
+ python download_and_convert_data.py --dataset_name=mnist --dataset_dir=" ${DATA_DIR} "
38
+ ```
40
39
41
40
<b >How to run:</b >
42
41
43
42
``` shell
44
43
# Clone the codes under differential_privacy.
45
44
# Create an empty WORKSPACE file.
46
- # Download the data to the data/ directory.
47
45
48
- # List the codes.
46
+ # List the codes (Optional) .
49
47
$ ls -R differential_privacy/
50
48
differential_privacy/:
51
49
dp_sgd __init__.py privacy_accountant README.md
@@ -71,21 +69,27 @@ BUILD gaussian_moments.py
71
69
differential_privacy/privacy_accountant/tf:
72
70
accountant.py accountant_test.py BUILD
73
71
74
- # List the data.
72
+ # List the data (optional).
73
+ $ mv /tmp/mnist/mnist_train.tfrecord data
74
+ $ mv /tmp/mnist/mnist_test.tfrecord data
75
75
$ ls -R data/
76
76
77
77
./data:
78
78
mnist_test.tfrecord mnist_train.tfrecord
79
79
80
- # Build the codes.
80
+ # Build the codes (optional) .
81
81
$ bazel build -c opt differential_privacy/...
82
82
83
- # Run the mnist differntial privacy training codes.
83
+ # Run the mnist differential privacy training codes.
84
+ # 1. With bazel
84
85
$ bazel-bin/differential_privacy/dp_sgd/dp_mnist/dp_mnist \
85
86
--training_data_path=data/mnist_train.tfrecord \
86
87
--eval_data_path=data/mnist_test.tfrecord \
87
88
--save_path=/tmp/mnist_dir
88
89
90
+ # 2. Or without (by default data is in /tmp/mnist)
91
+ python dp_sgd/dp_mnist/dp_mnist.py
92
+
89
93
...
90
94
step: 1
91
95
step: 2
0 commit comments