enerzyme.models.layers.rbf.ExponentialBernsteinRBFLayer#
- class enerzyme.models.layers.rbf.ExponentialBernsteinRBFLayer(num_rbf: int, no_basis_at_infinity: bool = False, init_alpha: float = 0.944863062918464, exp_weighting: bool = False, learnable_shape: bool = True, cutoff_sr: float = inf, cutoff_fn: Literal['polynomial', 'bump'] = 'bump')[source]#
Bases:
ExponentialRBF- __init__(num_rbf: int, no_basis_at_infinity: bool = False, init_alpha: float = 0.944863062918464, exp_weighting: bool = False, learnable_shape: bool = True, cutoff_sr: float = inf, cutoff_fn: Literal['polynomial', 'bump'] = 'bump') None[source]#
Radial basis functions based on exponential Bernstein polynomials given by: b_{v,n}(x) = (n over v) * exp(-alpha*x)**v * (1-exp(-alpha*x))**(n-v) (see https://en.wikipedia.org/wiki/Bernstein_polynomial)
For n to infinity, linear combination of b_{v,n}s can approximate any continuous function on the interval [0, 1] uniformly [1].
NOTE: There is a problem for x = 0, as log(-expm1(0)) will be log(0) = -inf. This itself is not an issue, but the buffer v contains an entry 0 and 0*(-inf)=nan. The correct behaviour could be recovered by replacing the nan with 0.0, but should not be necessary because issues are only present when r = 0, which will not occur with chemically meaningful inputs.
References:#
[1] Commun. Kharkov Math. Soc. 1912, 13, 1.