jax_privacy.clipping.ClippedGradOutput

jax_privacy.clipping.ClippedGradOutput#

class jax_privacy.clipping.ClippedGradOutput(gradient: Array | ndarray | bool | number | bool | int | float | complex | Iterable[TypeAliasForwardRef('optax.ArrayTree')] | Mapping[Any, TypeAliasForwardRef('optax.ArrayTree')], slack: Array)[source]#

Bases: NamedTuple

Gradient and slack fields forming a single primary query.

Both fields must be privatized together before slack is released.

Create new instance of ClippedGradOutput(gradient, slack)

Methods

__init__

count

Return number of occurrences of value.

index

Return first index of value.

Attributes

gradient

Alias for field number 0

slack

Alias for field number 1

gradient: Union[Array, ndarray, bool, number, bool, int, float, complex, Iterable[Union[Array, ndarray, bool, number, bool, int, float, complex, Iterable[ArrayTree], Mapping[Any, ArrayTree]]], Mapping[Any, Union[Array, ndarray, bool, number, bool, int, float, complex, Iterable[ArrayTree], Mapping[Any, ArrayTree]]]]#

Alias for field number 0

slack: Array#

Alias for field number 1