MixtureMatrixSampler#

class sdm.prior.MixtureMatrixSampler(samplers: Sequence[MatrixSampler | tuple[MatrixSampler, float]], correlated: bool = False, key: Hashable | None = None)#

Bases: MatrixSampler, Mixture[MatrixSampler]

Pick one matrix sampler per call from a weighted pool.

Parameters:
sample(size: Size | tuple[int, ...], dtype: dtype, generator: Generator | None = None) → Tensor#

Sample random matrices.

Parameters:
  • size (Size | tuple[int, ...]) – Output shape [..., M, N] with M rows and N columns per matrix.

  • dtype (dtype) – Output dtype.

  • generator (Generator | None) – Pseudorandom generator.

Returns:

Random matrices with shape size.

Return type:

Tensor