In this work we propose a method for joint privacy enhancement and quantization (JoPEQ), unifying lossy compression and privacy enhancement for federated learning. This repository contains a basic PyTorch implementation of JoPEQ. Please refer to our paper for more details. We note that the explicit use of the characteristic functions described in equations (14) and (15) of the paper leads to stability issues, with the performance depending much on how the frequency domain is being sampled. For this reason, the provided code uses Laplacian PPN while accounting for the quantization distortion in the second-order moments. It can be numerically verified that the resulting distribution is close to the desired Laplace.
This code has been tested on Python 3.7.3, PyTorch 1.8.0 and CUDA 11.1.
- PyTorch=1.8.0: https://pytorch.org
- scipy
- tqdm
- matplotlib
- torchinfo
- TensorboardX: https://github.com/lanpa/tensorboardX
python main.py --exp_name=jopeq --quntization --lattice_dim 2 --R 1 --privacy --privacy_noise jopeq_vector --epsilon 4 --sigma_squared 0.2 --nu 4
python main.py --exp_name=jopeq --eval