MolecularDiffusion.runmodes.train.tasks_gcdm

Factory wiring the ported GCDM/GCPNet backbone into the existing, unmodified diffusion task.

Structured like runmodes/train/tasks_gfmdiff.py – a new dynamics network dropped into EnVariationalDiffusion + GeomMolecularGenerative, with zero edits to either.

Per the approved integration plan (revision 2) this is a §1 backbone swap: GCDM’s own ~1800-line variational_diffusion.py is a line-for-line EDM re-implementation of maths the platform already has, so only GCPNetDynamics is ported.

The one thing this factory does that its four siblings (tasks_{egcl,egt,gfmdiff,painn}.py) do not is read include_charges from config instead of hardcoding True: GCDM’s GEOM checkpoint and its six per-property conditional QM9 checkpoints were all trained with include_charges: false (atom one-hot only, no atomic-number scalar). Defaults to True, so nothing about the other backbones changes.

Attributes

Classes

ModelTaskFactory

Build the GCDM-backbone diffusion model + task.

Module Contents

class MolecularDiffusion.runmodes.train.tasks_gcdm.ModelTaskFactory(task_type: str, train_set=None, atom_vocab=None, task_names: list = [], condition_names: list = [], include_charges: bool = True, num_encoder_layers: int = 9, hidden_dims: dict = {}, module_cfg: dict = {}, layer_cfg: dict = {}, chkpt_path: str = None, **kwargs)

Build the GCDM-backbone diffusion model + task.

Parameters:
  • task_type (str) – must be "diffusion".

  • train_set – unused; kept for interface parity with the other factories (GCPNet needs no dataset statistics at build time).

  • atom_vocab (list) – atom vocabulary used for one-hot encoding.

  • task_names (list) – conditional labels (context columns).

  • condition_names (list) – condition names for conditional generation.

  • include_charges (bool) – whether the diffusion latent carries the atomic-number scalar channel. True matches GCDM’s unconditional QM9 preset; False matches its GEOM and conditional-QM9 presets.

  • num_encoder_layers (int) – number of GCPInteractions blocks.

  • hidden_dims (dict) – h_hidden_dim / chi_hidden_dim / e_hidden_dim / xi_hidden_dim.

  • module_cfg (dict) – overrides for GCPModuleConfig.

  • layer_cfg (dict) – overrides for GCPLayerConfig.

  • chkpt_path (str) – optional path to a model checkpoint.

  • **kwargs – diffusion keyword arguments (see diffusion_gcdm.yaml).

build()

Build and return the GeomMolecularGenerative task.

atom_vocab = None
chkpt_path = None
condition_names = []
context_node_nf
hidden_dims
in_node_nf
include_charges = True
kwargs
layer_cfg
module_cfg
num_encoder_layers = 9
task_names = []
task_type
train_set = None
MolecularDiffusion.runmodes.train.tasks_gcdm.logger