jax_privacy.matrix_factorization.toeplitz.solve_banded

Contents

jax_privacy.matrix_factorization.toeplitz.solve_banded#

jax_privacy.matrix_factorization.toeplitz.solve_banded(coef, rhs)[source]#

Solve the linear system \(T_{\text{coef}} x = \text{rhs}\) for \(x\) for Toeplitz matrix \(T\).

Specifically, \(T_{\text{coef}}\) is a lower triangular banded Toeplitz matrix.

Note we want to be able to back-propagate gradients through this function, hence we cannot use scipy.linalg.solve_toeplitz().

Example: coef = [a, b, c], rhs = [1, 1, 1, 1, 1, 1], we solve the following system for x:

[a 0 0 0 0 0] [x_0]   [1]
[b a 0 0 0 0] [x_1]   [1]
[c b a 0 0 0] [x_2] = [1]
[0 c b a 0 0] [x_3]   [1]
[0 0 c b a 0] [x_4]   [1]
[0 0 0 c b a] [x_5]   [1]
Parameters:
  • coef (Array) – The nonzero coefficients of a lower-triangular Toeplitz matrix \(C\), that is, coef are the leading nonzero entries of \(C[:, 0]\). \(C\) is of size \(n \times n\) where n = len(rhs) (see below); if len(coef) < n, the remaining coefficients are assumed to be zero. If len(coef) > n, then only the first n coefficients are used.

  • rhs (Array) – The right hand side vector, of length n.

Return type:

Array

Returns:

The solution to the linear system Toeplitz(coef, n) x = rhs.