C'est le Code joint à la littérature,Le but de la littérature est d'explorer la relation entre les propriétés atomiques des matériaux et d'autres propriétés basées sur l'apprentissage profond.
J'ai intercepté cette partie pour établir un lien entre les caractéristiques atomiques et cristallines,Mais je ne comprends pas cette partie du Code,Merci à tous.
https://github.com/txie-93/cgcnn/blob/master/cgcnn/model.pyLe code complet est ici,Les objectifs sont énoncés dans la Section168Jusqu'à la fin
def pooling(self, atom_fea, crystal_atom_idx): """ Pooling the atom features to crystal features N: Total number of atoms in the batch N0: Total number of crystals in the batch Parameters ---------- atom_fea: Variable(torch.Tensor) shape (N, atom_fea_len) Atom feature vectors of the batch crystal_atom_idx: list of torch.LongTensor of length N0 Mapping from the crystal idx to atom idx """ assert sum([len(idx_map) for idx_map in crystal_atom_idx]) ==\ atom_fea.data.shape[0] summed_fea = [torch.mean(atom_fea[idx_map], dim=0, keepdim=True) for idx_map in crystal_atom_idx] return torch.cat(summed_fea, dim=0)