xnn.cnn.models.steerable.SteerableCNN#
- class xnn.cnn.models.steerable.SteerableCNN(species=(1, 6, 8), cutoff=4.0, grid_size=17, fields=None, n_features=32, n_blocks=3, l_max=2, kernel_size=5, strides=None, padding=None, activation='ssp', gate_activation='sigmoid', normalization=None, smooth_stride=True, bandlimit='compromise', shell_width=0.6, sigma=None, cutoff_fn='cosine', include_center=True, readout_activation='ssp', energy_shift=0.0, energy_scale=1.0, atomic_energies=None)[source]#
Bases:
VoxelPotential3D steerable CNN interatomic potential (Weiler et al., NeurIPS 2018).
The species density grids of
VoxelGrid(one scalar field per species) pass throughlen(fields)GatedBlockblocks; the last block outputs scalar fields only, which a global average pool turns into the invariant per-atom features of the shared readout. The defaults are the paper’s recipe scaled to environments: hidden blocks carry fields of order 0, 1 and 2 with multiplicities doubling block by block, kernels of side 5, a stride of 2 (low-pass filtered) in the inner blocks, gated nonlinearities, no batch normalization, thecompromisebandlimits and shells of width 0.6 voxels.- Parameters:
species (sequence of int, optional) – Atomic numbers with a density channel, by default
(1, 6, 8).cutoff (float, optional) – Radius of the voxelized environment (Angstrom), by default 4.0.
grid_size (int, optional) – Voxels per axis, by default 17.
fields (sequence of sequence of int or None, optional) – Multiplicities
(m_0, m_1, ...)of the output stack of each block; the last entry must be scalar only.Nonederives them fromn_features,n_blocksandl_max(default_fields()).n_features (int, optional) – Scalar fields of the last block when
fieldsisNone(and the readout width), by default 32.n_blocks (int, optional) – Number of blocks when
fieldsisNone, by default 3.l_max (int, optional) – Highest field order of the default hidden blocks, by default 2.
kernel_size (int, optional) – Side of the cubic kernels, by default 5.
strides (sequence of int or None, optional) – Downsampling per block;
Nonedownsamples by 2 in every block but the first and the last.padding (int or None, optional) – Zero padding;
Nonekeeps the grid size.activation (str, optional) – Activation of the scalar fields, by default
"ssp"(smooth, for a smooth energy surface; the paper’s networks use"relu").gate_activation (str, optional) – Activation of the gates, by default
"sigmoid".normalization (str or None, optional) –
"batch"forSteerableBatchNormin every block, by defaultNone.smooth_stride (bool, optional) – Low-pass filter before every downsampling, by default
True.bandlimit (str or sequence of int, optional) – Shell bandlimits of the kernels, by default
"compromise".shell_width (float, optional) – Width of the radial Gaussian shells in voxels, by default 0.6.
sigma (Optional[float]) – See
VoxelPotential.cutoff_fn (Optional[str]) – See
VoxelPotential.include_center (bool) – See
VoxelPotential.readout_activation (str) – See
VoxelPotential.energy_shift (float) – See
VoxelPotential.energy_scale (float) – See
VoxelPotential.atomic_energies – See
VoxelPotential.
- Variables:
blocks (torch.nn.Sequential) – The gated blocks.
fields (list of tuple of int) – The output multiplicities of every block.
- classmethod from_config(cfg)[source]#
Build a
SteerableCNNfrom a configuration object.cfg.cutoff,cfg.n_features(scalar fields of the last block) andcfg.n_interactions(number of blocks) are the core fields;cfg.extramay setspecies,grid_size,sigma,cutoff_fn,include_center,fields,l_max,kernel_size,strides,padding,activation,gate_activation,normalization,smooth_stride,bandlimit,shell_width,readout_activation,energy_shift,energy_scaleandatomic_energies.- Parameters:
cfg (xnn.common.config.schema.ModelConfig) – The model config.
- Returns:
The model.
- Return type: