[Doubts] Envelope Function
Closed this issue · 2 comments
shenoynikhil commented
- Why do the radial basis function and the spherical basis function need to be doubly differentiable?
- why are we using
$p - 1$ exponent
class Envelope(torch.nn.Module):
def __init__(self, exponent: int):
super().__init__()
self.p = exponent + 1
self.a = -(self.p + 1) * (self.p + 2) / 2
self.b = self.p * (self.p + 2)
self.c = -self.p * (self.p + 1) / 2
def forward(self, x: Tensor) -> Tensor:
p, a, b, c = self.p, self.a, self.b, self.c
x_pow_p0 = x.pow(p - 1)
x_pow_p1 = x_pow_p0 * x
x_pow_p2 = x_pow_p1 * x
return (
1. / x + a * x_pow_p0 + b * x_pow_p1 +
c * x_pow_p2) * (x < 1.0).to(x.dtype)
- equation according to the implementation looks like, was unable to understand why?
shenoynikhil commented
@gasteigerjo I had a few questions, I'll be really grateful if you could answer them.
gasteigerjo commented
- Sorry, that wasn't exactly accurate. They only need to be continuously differentiable, not twice differentiable. That's to ensure a smooth force.
- That's because the implementation pulls the 1/d of Equation 7 into the envelope function in Equation 8, to save some computation. Might be worth mentioning.