RandomGP#

class sdm.prior.RandomGP(a: HP[float] | float, alpha: HP[float] | float, num_features: int = 256)#

Bases: RandomFunction

Approximate a Gaussian process with random Fourier features.

Randomly choose radial frequencies with a scaled input projection or independent-coordinate frequencies without the projection.

Parameters:
  • a (HP[float] | float) – Shape parameter controlling the frequency distribution’s tail.

  • alpha (HP[float] | float) – Scale of the input projection for radial frequencies.

  • num_features (int) – Number of random Fourier features.

forward(x: Tensor, out_channels: int, generator: Generator | None = None) → Tensor#

Apply a sampled function to every row of x.

Parameters:
  • x (Tensor) – Input values with shape [R, H] for rows and channels.

  • out_channels (int) – Number of output channels.

  • generator (Generator | None) – Pseudorandom generator.

Returns:

Node values with shape [R, out_channels].

Return type:

Tensor