xnn.gnn.fast.linear#

Equivariant linear maps of the MACE blocks, with a fast path in plain PyTorch.

Two maps spend most of their time on work whose result is known in advance. An e3nn.o3.Linear reads its input irrep block by irrep block from slices, and the backward of every slice is a zero-filled gradient of the full input width, summed over the blocks. The self-connection of an interaction, a tensor product with the one-hot element of each atom, multiplies by the weights of every element of the model, all but one of them with a zero.

The fast paths split the input once (whose backward is one concatenation) and multiply the atoms of each element by that element’s weights only. They give the reference’s numbers up to the summation order, and their derivatives of any order are those of plain PyTorch operations.

Classes

EquivariantLinear(*args, **kwargs)

e3nn.o3.Linear (same arguments, parameters and state_dict) with a fast path.

SpeciesTensorProduct(*args, **kwargs)

Tensor product with the one-hot chemical element of each atom, with a fast path.