Metadata-Version: 2.4
Name: opake-dpsgd
Version: 0.16.1
Summary: Opake DP-SGD: Gaussian noise, per-group calibration, AdamW-BC
Author: Opake Contributors
License-Expression: Apache-2.0
Keywords: differential-privacy,dp-sgd,pytorch,privacy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security
Requires-Python: <3.14,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: torch>=2.9.0
Requires-Dist: opake-engine==0.16.1
Requires-Dist: opake-accounting==0.16.1
Provides-Extra: optimizers
Requires-Dist: opake-optimizers==0.16.1; extra == "optimizers"
Dynamic: license-file

# opake-dpsgd

DP-SGD mechanisms for Opake: Gaussian noise, clipping (fixed, AUTO-S,
adaptive), and Poisson subsampling. Functional optimizers
(including the universal `adamw` with optional DP bias correction) live in
[`opake.optimizers`](../opake-optimizers/README.md).

## Install

Install the root package as described in the [repository installation guide](https://github.com/JetBrains-Research/opake#installation).
`opake-dpsgd` is included in the default `opake` package set.

## Quick start

```python
from opake.dpsgd.clipping import auto_clipped_grad, clipped_grad
from opake.random import key
from opake.dpsgd.clipping import adaptive_clipped_grad
from opake.dpsgd.noise import gaussian_noise
from opake.dpsgd.sampling import PoissonSampler
```

## Layout

- `opake.dpsgd.noise` — `gaussian_noise`
- `opake.dpsgd.clipping` — `clipped_grad`, `auto_clipped_grad`, `per_group`, `adaptive_clipped_grad`, `.types`, `.fun`
- `opake.dpsgd.sampling` — `PoissonSampler` (optional `truncated_batch_size`)

RNG keys, pytree helpers, distributed plumbing, and serialization live in
[`opake-engine`](../opake-engine/README.md).
