xnn.gnn.models.cgcnn#

CGCNN: crystal graph convolutional neural networks (Xie and Grossman, Phys. Rev. Lett. 120, 145301 (2018)).

A CGCNN predicts one property per crystal (a formation energy per atom, a band gap, a modulus) from a graph that connects every atom i to its nearest neighbors j. Each atom starts from a fixed feature vector of its element, mapped by a dense layer to v_i; each bond carries a Gaussian expansion u_ij of its length. Every convolution concatenates z_ij = v_i + v_j + u_ij and updates (eq. 5 of the paper)

v_i' = g(v_i + BN(sum_j sigmoid(BN(z_ij W_f + b_f)) * g(BN(z_ij W_s + b_s)))),

with g the softplus and BN batch normalization (over the bonds inside the sum, over the atoms outside it). The mean of the v_i of a crystal passes through the softplus and dense layers with softplus activations to the output.

The defaults are those of the authors’ code: the 12 nearest neighbors within 8 Angstrom, 41 Gaussians exp(-(r - mu)^2 / 0.2^2) on [0, 8], 64 atom features, three convolutions and one hidden layer of 128. The atom features are the authors’ 92-column element table, downloaded on first use. The paper’s eq. 5 has neither the batch normalizations nor the outer softplus: normalization=None and residual_activation=False.

The output is "properties", one value (or n_outputs values) per crystal, standardized as property_scale * y + property_shift. With classification=True the output layer gives two classes and "properties" is the probability of the second (a metal, for the authors’ metal / semiconductor model). Train it with optim.property_weight on properties labels. The model predicts no energy, so it gives no forces or stress.

Module Attributes

CGCNN_TABLE_SHAPE

Rows (atomic numbers 0 to 100) and columns of the authors' element feature table.

Functions

read_atom_features(spec[, n_elements])

An element feature table (rows, features) whose row Z belongs to atomic number Z.

Classes

CGCNN([n_features, n_interactions, n_rbf, ...])

CGCNN property model of crystals.

ConvLayer(n_features, n_rbf[, ...])

One CGCNN convolution (eq.