A package for applying differential privacy to model weights
Project description
forgetnet
A package for applying differential privacy to model weights.
Installation
pip install forgetnet
from forgetnet.dp_weights import calculate_noise_scale_poly, apply_noise_to_all_weights
Example usage
model = ... # Your PyTorch model
epsilon = 1.0
delta = 1e-5
clipping_norm = 1.0
dataset_size = 10000
batch_size = 32
num_epochs = 10
learning_rate = 0.001
apply_noise_to_all_weights(
model,
calculate_noise_scale_poly,
epsilon,
delta,
clipping_norm,
dataset_size,
batch_size,
num_epochs,
learning_rate
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
forgetnet-0.1.4.tar.gz
(2.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forgetnet-0.1.4.tar.gz.
File metadata
- Download URL: forgetnet-0.1.4.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
833561f6b8c3666016ad9421acc3267c11255869b5e6adb18d9a075ad24e5c71
|
|
| MD5 |
df9b27c32cee44694c8c826ff50c0886
|
|
| BLAKE2b-256 |
c88aabc03cbc71d4af7685b68b6e2d9c9cb18e0e763a520d7205c8e5b025a8af
|
File details
Details for the file forgetnet-0.1.4-py3-none-any.whl.
File metadata
- Download URL: forgetnet-0.1.4-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a140d5514c7a452d1b3d5923834672016cea0dbf47fd5c44cd4000ff558ae844
|
|
| MD5 |
17be683fd4dcf032a250fff3afb933e6
|
|
| BLAKE2b-256 |
4e9919378f096c2a648cf9ebeb335bcc3563864d4d674f1056a4896a387683c5
|