xnn.common.featurizers.radial.make_radial_basis#

xnn.common.featurizers.radial.make_radial_basis(name, n_rbf, cutoff, trainable=False, *, gamma=None, prefactor=None)[source]#

A radial basis by name: the bases shared by every model that lets the basis be chosen.

An option the chosen basis does not have is ignored with an IgnoredOptionWarning.

Parameters:
  • name (str) – "gaussian" (GaussianRBF: n_rbf Gaussians centered on [0, cutoff], the center spacing as width unless gamma is given; the centers stay exact in float64 through casts and loads), "bessel" (BesselRBF, prefactor * sin(n pi r / cutoff) / r) "expnorm" (ExpNormalSmearing, Gaussians in exp(-r) with their own cosine envelope) or "smooth_bessel" (SmoothBesselRBF, orthogonal spherical Bessel combinations that vanish smoothly at the cutoff).

  • n_rbf (int) – Number of basis functions.

  • cutoff (float) – The cutoff radius.

  • trainable (bool, optional) – Learn the parameters of the basis (the Bessel frequencies, the exponential-normal centers and widths); the Gaussian basis has none.

  • gamma (float or None, optional) – The exponent of the Gaussians, exp(-gamma (r - mu)^2).

  • prefactor (float or None, optional) – The normalization of the Bessel functions (None: sqrt(2 / cutoff)).

Returns:

Maps distances (...) to (..., n_rbf).

Return type:

torch.nn.Module

Raises:

ValueError – For an unknown name.