xnn.gnn.models.cgcnn.ConvLayer#

class xnn.gnn.models.cgcnn.ConvLayer(n_features, n_rbf, normalization='batch', residual_activation=True)[source]#

Bases: Module

One CGCNN convolution (eq. 5 of the paper, with the authors’ batch normalizations).

Parameters:
  • n_features (int) – Width of the atom features.

  • n_rbf (int) – Width of the bond features.

  • normalization (str or None, optional) – "batch" (default): batch normalization of the gates and of the neighbor sums; None: none.

  • residual_activation (bool, optional) – Pass the residual sum through the softplus, by default True.

forward(x, u, src, dst, per_atom=None)[source]#

Update the atom features x (N, F) from the bond features u (E, R) of the edges src -> dst; with per_atom, the edges are grouped by dst, per_atom for every atom.

Parameters:
Return type:

Tensor