xnn.gnn.featurizers.radial.BesselRBF#
- class xnn.gnn.featurizers.radial.BesselRBF(n_rbf=8, cutoff=5.0, trainable=False, prefactor=None)[source]#
Bases:
ModuleBessel radial basis (NequIP/DimeNet-style), smoother & fewer functions.
Expands an interatomic distance
rinto a set ofn_rbfinvariant radial features using the normalized sinc/Bessel functionsprefactor * sin(n*pi*r/rc) / rforn = 1, ..., n_rbf. Compared with a Gaussian basis this is smoother and needs fewer functions to cover the cutoff sphere.- Parameters:
n_rbf (int, optional) – Number of Bessel basis functions (output width). Default is 8.
cutoff (float, optional) – Cutoff radius
rcused to set the basis frequencies and the normalization. Default is 5.0.trainable (bool, optional) – If
True, then * pifrequencies are a learnabletorch.nn.Parameter(the NequIPBesselBasisdefault); otherwise a fixed buffer (the MACE default). Default isFalse.prefactor (float, optional) – Overall normalization factor.
None(default) uses the DimeNet/MACE conventionsqrt(2 / cutoff); the original NequIP uses2 / cutoff.
- Variables:
freqs (Tensor) – The angular frequencies
n * piof shape(n_rbf,)– a registered buffer, or atorch.nn.Parameterwhentrainable.norm (float) – The scalar normalization
prefactor.