# tf_privacy.compute_dp_sgd_privacy

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/privacy/blob/v0.9.0/privacy/privacy/analysis/compute_dp_sgd_privacy_lib.py#L445-L496) |

Compute epsilon based on the given hyperparameters.

    tf_privacy.compute_dp_sgd_privacy(
        n, batch_size, noise_multiplier, epochs, delta
    )

This function is deprecated. It does not account for doubling of sensitivity
with microbatching, and assumes Poisson subsampling, which is rarely used in
practice. (See "How to DP-fy ML: A Practical Guide to Machine Learning with
Differential Privacy", <https://arxiv.org/abs/2303.00654,> Sec 5.6.) Most users
should call `compute_dp_sgd_privacy_statement`, which provides appropriate
context for the guarantee (see the reporting recommendations in "How to DP-fy
ML", Sec 5.3). If you need a numeric epsilon value under specific assumptions,
it is recommended to use the `dp_accounting` libraries directly to compute
epsilon, with the precise and correct assumptions of your application.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `n` | Number of examples in the training data. |
| `batch_size` | Batch size used in training. |
| `noise_multiplier` | Noise multiplier used in training. |
| `epochs` | Number of epochs in training. |
| `delta` | Value of delta for which to compute epsilon. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A 2-tuple containing the value of epsilon and the optimal RDP order. ||

<br />