Skip to main content

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


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.1.tar.gz (1.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forgetnet-0.1.1-py3-none-any.whl (1.6 kB view details)

Uploaded Python 3

File details

Details for the file forgetnet-0.1.1.tar.gz.

File metadata

  • Download URL: forgetnet-0.1.1.tar.gz
  • Upload date:
  • Size: 1.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for forgetnet-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5545e3871ca23ba5c58b79d7f0392fd09b7b28b3277485c3ea1c2092ae5d9de1
MD5 42ebf3391cc45e50c01aca7fa218b5a3
BLAKE2b-256 cec60ffb29569eeb6bb9b6f41c1e94d4801f17e4886a39dc5486464dfee50e2e

See more details on using hashes here.

File details

Details for the file forgetnet-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: forgetnet-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for forgetnet-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ec771b11c2a25534ef4513073b08a98eccb64ea4b53ff17596d559120a9c099
MD5 34a80d88244b577e928d2b21b704d667
BLAKE2b-256 5a89aed97dbdc9867e261570f9b284ff9df5cda302cd7f9ea819d859338d0009

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page