xnn.common.models.blocks.GatedEquivariantBlock#
- class xnn.common.models.blocks.GatedEquivariantBlock(n_in_s, n_in_v, n_out_s, n_out_v, n_hidden=None, scalar_activation=True, n_norm=None, activation='silu')[source]#
Bases:
ModuleGated equivariant block (Weiler et al. 2018; Schuett et al. 2021, Fig. 3).
Two linear maps of the vector features give
W_1 vandW_2 v; the norm of the first is stacked with the scalars and fed through a two-layer network whose output is split into new scalars and a gate that scalesW_2 v. Scalars pass through a nonlinearity, vectors are only scaled, so the block is equivariant.- Parameters:
n_in_s (int) – Input scalar and vector widths.
n_in_v (int) – Input scalar and vector widths.
n_out_s (int) – Output scalar and vector widths.
n_out_v (int) – Output scalar and vector widths.
n_hidden (int or None, optional) – Width of the hidden layer of the scalar network, by default
n_in_s.scalar_activation (bool, optional) – Whether the activation is applied to the output scalars (the hidden blocks of a stack); off for the last block. Default
True.n_norm (int or None, optional) – Width of the normed vector branch
W_1 v:n_out_v(default, the PaiNN reference code) orn_in_v(the TorchMD-Net output network).activation (str or torch.nn.Module, optional) – The nonlinearity of the scalar network, by default
"silu".