xnn.common.deploy.lammps.export_to_lammps#
- xnn.common.deploy.lammps.export_to_lammps(model, cutoff, path, metadata=None, total_charge=0.0)[source]#
Script the model and save a
.ptusable by a LAMMPS pair style.Wraps
modelinLAMMPSWrapper, compiles it withtorch.jit.scriptand saves the scripted module topath. The cutoff (and any provided metadata) is embedded as extra files inside the archive, with all values stored as strings.- Parameters:
model (torch.nn.Module) – The trained model to serialize (must provide a scriptable
node_energycore, as required byLAMMPSWrapper).cutoff (float) – Neighbor-list cutoff radius; stored in the archive under the
"cutoff"extra-file key.path (str) – Destination file path for the scripted
.ptarchive.metadata (dict or None, optional) – Additional key/value metadata to embed as extra files. Values are stringified. Defaults to
None.total_charge (float, optional) – Net charge of the system for a D4-wrapped model, by default 0.
- Returns:
The
paththe scripted model was saved to.- Return type: