Layers

Overview

This module contains layers to be used for building models.

class layers.RBFExpansion(low, high, count)

A continuous-filter convolutional radial basis filter input from SchNet. The input should be a rank K tensor of distances. The output will be rank K with the new axis being of dimension count. The distances are converted with \(\exp\gamma\left(d - \mu\right)^2\) where \(\mu\) is an evenly spaced grid from low to high containing count elements. The distance between elements is \(1 / \gamma\).

__init__(low, high, count)
Parameters:
  • low (float) – lowest \(\mu\)
  • high (float) – high \(\mu\) (inclusive)
  • count (int) – Number of elements in \(\mu\) and output last axis dimension
class layers.WCARepulsion(sigma, regularization_strength=0.001)

A trainable Weeks-Chandler-Anderson repulsion. The input should be the neighbor list.

\[\begin{split}U(r) = \begin{cases} \left(\frac{\sigma}{r}\right)^6 & r\leq 2^{1/3}\sigma \\ 0 & r\geq 2^{1/3}\sigma \end{cases}\end{split}\]

where \(\sigma\) is a trainable variable set by start. A regularization is applied to push \(\sigma\) to higher distances.

__init__(sigma, regularization_strength=0.001)
Parameters:
  • sigma (float) – starting \(\sigma\) value
  • regularization_strength (float) – factor on regularization
class layers.EDSLayer(set_point, period, learning_rate=0.01, cv_scale=1.0, name='eds-layer', **kwargs)

This layer computes and returns the Lagrange multiplier/EDS coupling constant (alpha) to be used as the EDS bias in the simulation. You call the layer on the collective variable at each step to get the current value of alpha.

Parameters:
  • set_point – The set point value of the collective variable. This is a constant value which is pre-determined by the user and unique to each cv.
  • period – Time steps over which the coupling constant is updated. Hoomd time units are used. If period=100 alpha will be updated each 100 time steps.
  • learninig_rate – Learninig_rate in the EDS method.
  • cv_scale – Used to adjust the units of the bias to Hoomd units.
  • name – Name to be used for layer
Returns:

Alpha, the EDS coupling constant.