GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — alignn/alignn/examples/recipes/forcefield at main · atomgptlab/alignn

Expand file tree

/

forcefield

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

forcefield

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
config_example.json
config_example.json
 
 
make_toy_dataset.py
make_toy_dataset.py
 
 

README.md

Outline

ALIGNN example: Force field (energy + forces + stress)

Train an ALIGNN-FF interatomic potential that outputs energy, analytic forces (gradients of the energy), and stress — usable for relaxation and molecular dynamics (including LAMMPS via pair_alignn). Uses the radius graph (cutoff: 5.0).

Run it (CPU, ~1-2 min)

# 1) generate a tiny synthetic dataset -> id_prop.json
python make_toy_dataset.py

# 2) train (10 epochs on the toy data)
train_alignn.py --root_dir . --config_name config_example.json --output_dir toy_out --target_key energy_per_atom --force_key forces --id_key jid

You should see per-epoch Train Loss / Val Loss lines and a final Test MAE, with results written to toy_out/ (history_val.json, predictions, checkpoint).

Key config knobs (config_example.json)

  • model.calculate_gradient: true — forces are the true gradient of the energy (energy-conserving).
  • graphwise_weight (energy), gradwise_weight (forces), stresswise_weight (stress) — the loss mixture.
  • Pass --force_key forces; stresses are read automatically if present.

Energy must be per atom (energy_per_atom) in id_prop.json, not per structure. Forces are Natoms x 3, stresses Voigt-6.

⚠️ This is a smoke test, not a real model

The synthetic dataset (40 rattled Si cells with fake targets) exists only to prove the pipeline runs. For a usable model:

  • Replace the toy structures/labels in make_toy_dataset.py with real DFT data (thousands to millions of entries).
  • Raise epochs to 100-300 and batch_size to 32-64 in config_example.json.
  • Expect training to take much longer and to need a GPU for large datasets.

Dataset format (id_prop.json)

A JSON list; each entry has a jid, an inline jarvis Atoms dict, and the target(s):

[{"jid": "toy-0", "atoms": {...}, "energy_per_atom": ...}]
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.