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,coefare the leading nonzero entries of \(C[:, 0]\). \(C\) is of size \(n \times n\); iflen(coef) < n, the remaining coefficients are assumed to be zero. Iflen(coef) > n, then only the firstncoefficients are used.n (
int|None) – Optional, the size of the matrix \(C\) (seecoefabove). IfNone, 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. Usejnp.meanto optimize mean-squared-error,jnp.maxto optimize max squared error (which is equivalent tolambda 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.