jax_privacy.matrix_factorization.streaming_matrix.scale_rows_and_columns#
- jax_privacy.matrix_factorization.streaming_matrix.scale_rows_and_columns(matrix, row_scale=None, col_scale=None)[source]#
Returns a new
StreamingMatrixwith scaled rows and/or cols.Assumes row_scale and col_scale can be indexed into for as many outputs are generated from matrix. If
jax.Arrayobjects are used, note row_scale[i] for i > len(row_scale) will return row_scale[-1].- Parameters:
matrix (
StreamingMatrix) – The matrix to wrap.row_scale (
Array|None) – Multipliers to apply to the rows ofmatrix, equivalent tojnp.diag(row_scale) @ matrix.col_scale (
Array|None) – Multipliers to apply to the columns ofmatrix, equivalent tomatrix @ jnp.diag(col_scale).
- Return type:
- Returns:
The wrapped
StreamingMatrix.