IMLCV.implementations.CV#
Module Contents#
Classes#
use in combination with swaplink |
|
creates bijective CV function based on a distrax flow. The seup function should initialize the bijector |
|
class to keep track of topology of given CV. Identifies the periodicitie of CVs and maps to unit square with correct peridicities |
|
class to keep track of topology of given CV. Identifies the periodicitie of CVs and maps to unit square with correct peridicities |
Functions#
|
|
|
from https://stackoverflow.com/questions/20305272/dihedral-torsion- |
|
|
|
|
|
|
|
axis 0 is batch axis |
|
|
|
|
|
- IMLCV.implementations.CV.Volume(sp: IMLCV.base.CV.SystemParams, _)[source]#
- IMLCV.implementations.CV.dihedral(numbers: list[int] | Array)[source]#
from https://stackoverflow.com/questions/20305272/dihedral-torsion- angle-from-four-points-in-cartesian- coordinates-in-python.
- Parameters:
numbers – list with index of 4 atoms that form dihedral
- IMLCV.implementations.CV.sb_descriptor(r_cut, n_max: int, l_max: int, references: SystemParams | None = None, references_nl: NeighbourList | None = None, reduce=True, reshape=False)[source]#
- IMLCV.implementations.CV.NoneCV() IMLCV.base.CV.CollectiveVariable[source]#
- IMLCV.implementations.CV.scale_cv_trans(array: IMLCV.base.CV.CV)[source]#
axis 0 is batch axis
- IMLCV.implementations.CV.trunc_svd(m: IMLCV.base.CV.CV) tuple[IMLCV.base.CV.CV, IMLCV.base.CV.CvTrans][source]#
- IMLCV.implementations.CV.get_sinkhorn_divergence(nli: NeighbourList | None, pi: Array | None, sort='rematch', alpha_rematch=0.1)[source]#
- IMLCV.implementations.CV.un_atomize(x: IMLCV.base.CV.CV, nl, _)[source]#
- class IMLCV.implementations.CV.RealNVP[source]#
Bases:
IMLCV.base.CV.CvFunNnuse in combination with swaplink
- cv_input: IMLCV.base.CV.CvFunInput[source]#
- setup() None[source]#
Initializes a Module lazily (similar to a lazy
__init__).setupis called once lazily on a module instance when a module is bound, immediately before any other methods like__call__are invoked, or before asetup-defined attribute on self is accessed.This can happen in three cases:
Immediately when invoking
apply(),init()orinit_and_output().Once the module is given a name by being assigned to an attribute of another module inside the other module’s
setupmethod (see__setattr__()):class MyModule(nn.Module): def setup(self): submodule = Conv(...) # Accessing `submodule` attributes does not yet work here. # The following line invokes `self.__setattr__`, which gives # `submodule` the name "conv1". self.conv1 = submodule # Accessing `submodule` attributes or methods is now safe and # either causes setup() to be called once.
Once a module is constructed inside a method wrapped with
compact(), immediately before another method is called orsetupdefined attribute is accessed.
- forward(x: IMLCV.base.CV.CV, nl: NeighbourList | None, conditioners: list[CV] | None = None)[source]#
- backward(z: IMLCV.base.CV.CV, nl: NeighbourList | None, conditioners: list[CV] | None = None)[source]#
- class IMLCV.implementations.CV.DistraxRealNVP[source]#
Bases:
IMLCV.base.CV.CvFunDistraxcreates bijective CV function based on a distrax flow. The seup function should initialize the bijector
- class RealNVP(CvFunDistrax):
_: dataclasses.KW_ONLY latent_dim: int
- def setup(self):
self.s = Dense(features=self.latent_dim) self.t = Dense(features=self.latent_dim)
# Alternating binary mask. self.bijector = distrax.as_bijector(
- tfp.bijectors.RealNVP(
fraction_masked=0.5, shift_and_log_scale_fn=self.shift_and_scale,
)
)
- def shift_and_scale(self, x0, input_depth, **condition_kwargs):
return self.s(x0), self.t(x0)
- class IMLCV.implementations.CV.MetricUMAP(periodicities, bounding_box=None)[source]#
Bases:
IMLCV.base.CV.CvMetricclass to keep track of topology of given CV. Identifies the periodicitie of CVs and maps to unit square with correct peridicities
- class IMLCV.implementations.CV.hyperTorus(n)[source]#
Bases:
IMLCV.base.CV.CvMetricclass to keep track of topology of given CV. Identifies the periodicitie of CVs and maps to unit square with correct peridicities