xnn.cnn.models.cnn3d.CNN3D#
- class xnn.cnn.models.cnn3d.CNN3D(species=(1, 6, 8), cutoff=4.0, grid_size=17, channels=None, n_features=32, n_blocks=3, kernel_size=5, strides=None, padding=None, activation='ssp', normalization=None, smooth_stride=True, sigma=None, cutoff_fn='cosine', include_center=True, readout_activation='ssp', energy_shift=0.0, energy_scale=1.0, atomic_energies=None)[source]#
Bases:
VoxelPotentialConventional 3D convolutional potential over voxelized environments.
len(channels)Conv3dBlockblocks map the species density grids ofVoxelGridtochannels[-1]feature maps, which a global average pool turns into the per-atom features of the shared readout. The defaults mirror the steerable model (default_fields()): the channel count of each block equals the number of components of the steerable fields of the same block, the paper’s recipe for its CNN baselines.- 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.
channels (sequence of int or None, optional) – Output channels of each block;
Nonederives them fromn_featuresandn_blocks.n_features (int, optional) – Channels of the last block when
channelsisNone(and the readout width), by default 32.n_blocks (int, optional) – Number of blocks when
channelsisNone, by default 3.kernel_size (int, optional) – Side of the cubic kernels, by default 5.
strides (sequence of int or None, optional) – Downsampling factor per block;
Nonedownsamples by 2 in every block but the first and the last.padding (int or None, optional) – Zero padding of every convolution;
Nonekeeps the grid size.activation (str, optional) – Activation of the blocks, by default
"ssp"(smooth, for a smooth energy surface; the paper’s networks use"relu").normalization (str or None, optional) –
"batch"for batch normalization in every block, by defaultNone.smooth_stride (bool, optional) – Low-pass filter before every downsampling (default), see
low_pass_filter().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 convolution blocks.
- classmethod from_config(cfg)[source]#
Build a
CNN3Dfrom a configuration object.cfg.cutoff,cfg.n_features(channels of the last block) andcfg.n_interactions(number of blocks) are the core fields;cfg.extramay setspecies,grid_size,sigma,cutoff_fn,include_center,channels,kernel_size,strides,padding,activation,normalization,smooth_stride,readout_activation,energy_shift,energy_scaleandatomic_energies.- Parameters:
cfg (xnn.common.config.schema.ModelConfig) – The model config.
- Returns:
The model.
- Return type: