jax_privacy.matrix_factorization.buffered_toeplitz.StreamingMatrixBuilder

class jax_privacy.matrix_factorization.buffered_toeplitz.StreamingMatrixBuilder(*, buf_decay, output_scale)[source]

Bases: object

Builder to convert a BLT to a StreamingMatrix.

Variables:
  • buf_decay – A numpy array of shape (num_buffers,) representing the decay factors for each buffer.

  • output_scale – A numpy array of shape (num_buffers,) representing the scale factors applied to each buffer when reading the output.

Methods

__init__

build

Returns a StreamingMatrix representing C.

build_inverse

Returns a StreamingMatrix representing C^{-1}.

Attributes

dtype

Returns the dtype of the BLT parameters.

buf_decay

output_scale

buf_decay: ndarray
output_scale: ndarray
property dtype: dtype

Returns the dtype of the BLT parameters.

build()[source]

Returns a StreamingMatrix representing C.

This implements Alg 2 of https://arxiv.org/pdf/2408.08868

Return type:

StreamingMatrix

build_inverse()[source]

Returns a StreamingMatrix representing C^{-1}.

This implements Alg 3 of https://arxiv.org/pdf/2408.08868

Return type:

StreamingMatrix