Modules¶
Potentials¶
Ped-ped interaction potential based on distance b.
v0 is in m^2 / s^2. sigma is in m.
Calculate b.
Value of potential parametrized with b.
Value of potential explicitely parametrized with r_ab.
Construct r_ab using broadcasting.
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
Compute gradient wrt r_ab using finite difference differentiation.
Compute gradient wrt r_ab using autograd.
Compute gradient wrt r_ab using autograd.
Norm of r_ab.
Special treatment of diagonal terms for backpropagation.
Without this treatment, backpropagating through a norm of a zero vector gives nan gradients.