List operations#

s2scat.utility.reorder.list_to_array(S1: List[float64], P00: List[float64], C01: List[float64], C11: List[float64]) Tuple[Array]#

Converts list of statistics to array of statistics for e.g. Loss functions.

Parameters:
  • S1 (List[jnp.float64]) – Mean field statistic \(\langle |\Psi^\lambda f| \rangle\).

  • P00 (List[jnp.float64]) – Second order power statistic \(\langle |\Psi^\lambda f|^2 \rangle\).

  • C01 (List[jnp.float64]) – Fourth order covariance statistic \(\text{Cov}\big [ \Psi^\lambda_1 f, \Psi^{\lambda_1} | \Psi^{\lambda_2} f | \big ]\).

  • C11 (List[jnp.float64]) – Sixth order covariance statistic \(\text{Cov}\big [ \Psi^{\lambda_1} | \Psi^{\lambda_3} f |, \Psi^{\lambda_1} | \Psi^{\lambda_2} f | \big ]\).

Returns:

Tuple of (S1, P00, C01, C11) arrays encoding scattering covariance statistics.

Return type:

Tuple[jnp.ndarray]

Notes

\(\lambda = (j, n)\) is an index which corresponds to both scale \(j\) and direction \(n\). Hence each \(\lambda\) corresponds to two degrees of freedom making, for example, C11 a sixth order covariance.

s2scat.utility.reorder.nested_list_to_list_of_arrays(Nj1j2: List[List[List[Array]]], J_min: int, J_max: int, delta_j: int = None) List[Array]#

Specific reindexing function which switches covariance wavelet scale list ordering.

Parameters:
  • Nj1j2 (List[List[jnp.ndarray]]) – Nested list of second order wavelet coefficients.

  • J_min (int) – Minimum dyadic wavelet scale to consider.

  • J_max (int) – Maximum dyadic wavelet scale to consider.

  • delta_j (int, optional) – Range of wavelet scales over which to compute covariances. If None, covariances between all scales will be considered. Defaults to None.

Returns:

Compressed list of all scattering covariances that end in scale \(j2\).

Return type:

List[jnp.ndarray]

Notes

Within the scattering covariance transform one performs the wavelet transform of the modulus of the wavelet transform of a signal. Consequently, one recovers nested lists indexed by the two wavelet scales \(j_1, j_2\) for the two wavelet transforms. The harmonic bandlimit of the output signal is capped by the lower of these two scales, which by construction is the second (the modulus operation forces information to lower scales).

Therefore, by reversing scale indexing \(j_1 \leftrightarrow j_2\) all internal arrays are of the same dimension, which simplifies the subsequent covariance statistics which are computed from combindations of these arrays.