jax_privacy.matrix_factorization.toeplitz.loss

Contents

jax_privacy.matrix_factorization.toeplitz.loss#

jax_privacy.matrix_factorization.toeplitz.loss(strategy_coef, n=None, reduction_fn=<function mean>)[source]#

Error of \(C\) on prefix workload under single participation.

See Scaling up the Amplified Banded Matrix Factorization Mechanism for Differentially Private ML (McKenna (2024)) for details.

Parameters:
  • strategy_coef (Array) – The nonzero coefficients of the Toeplitz matrix \(C\) used in the matrix mechanism with factorization \(A = BC\). That is, coef are the leading nonzero entries of \(C[:, 0]\). \(C\) is of size \(n \times n\); if len(coef) < n, the remaining coefficients are assumed to be zero. If len(coef) > n, then only the first n coefficients are used.

  • n (int | None) – Optional, the size of the matrix \(C\) (see coef above). If None, the size of the matrix is equal to the number of coefficients.

  • reduction_fn (Callable[[Array], Array]) – A function that converts per query squared errors to a scalar. Use jnp.mean to optimize mean-squared-error, jnp.max to optimize max squared error (which is equivalent to lambda v: v[-1] in this case).

Return type:

Array

Returns:

The total squared error times sensitivity of the toeplitz \(C\) on the prefix-sum workload under single participation.