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.2.tar.gz (2.4 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.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: forgetnet-0.1.2.tar.gz
  • Upload date:
  • Size: 2.4 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.2.tar.gz
Algorithm Hash digest
SHA256 84b3c8ca1aa8182d868112df4a7a85bee9afd1a9f39cb929af358fc7dd4d5ac7
MD5 aca0aa1c18e3225127e09a3550fd89ee
BLAKE2b-256 12af3a9f5e6377ddfc815745100f8c31b9f529c132b27b0a79b8c1d4bb227fc1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: forgetnet-0.1.2-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

Hashes for forgetnet-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ccf603e3785ae31f4d46174348557d32ca5762c82be9d46a0970f2c34db41721
MD5 74e34bbd03d823ec3aa6f6099a24bdbd
BLAKE2b-256 16c142d11806475bcba683daac35f18fdcf65b7173ee83b815c617c5bf31c473

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