# tf_privacy.make_keras_generic_optimizer_class

<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/optimizers/dp_optimizer_keras.py#L35-L402) |

Returns a differentially private (DP) subclass of `cls`.

    tf_privacy.make_keras_generic_optimizer_class(
        cls: Type[tf.keras.optimizers.Optimizer]
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `cls` | Class from which to derive a DP subclass. Should be a subclass of [`tf.keras.optimizers.legacy.Optimizer`](https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/legacy/Optimizer). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A generic DP-SGD subclass of `cls`, compatible with many DP queries. ||

<br />