# Rf Hgn Eval

> Evaluates the training efficiency, accuracy, and zero-shot generalization capability of Hamiltonian Graph Networks (RF-HGNs) on mass-spring physical systems. It benchmarks the proposed random-feature training method against standard gradient-based optimizers and existing physics-informed graph architectures. Use when the user wants to benchmark on 3D lattice mass-spring system, 2D open chain mass-spring system, 2D closed chain mass-spring system (Thangamuthu et al. [87]), or asks about evaluating this task. Reports Test MSE.

- Skill: `qhjqhj00/rf-hgn-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/rf-hgn-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/rf-hgn-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/rf-hgn-eval

---


# rf-hgn-eval

> Rapid training of Hamiltonian graph networks using random features — Rahma et al. (2025) (arXiv:2506.06558, 2025)

## What this evaluates

Evaluates the training efficiency, accuracy, and zero-shot generalization capability of Hamiltonian Graph Networks (RF-HGNs) on mass-spring physical systems. It benchmarks the proposed random-feature training method against standard gradient-based optimizers and existing physics-informed graph architectures.

## Datasets

- **3D lattice mass-spring system** — total ?; splits: train (-1), test (-1)
- **2D open chain mass-spring system** — total ?; splits: train (-1), test (-1)
- **2D closed chain mass-spring system (Thangamuthu et al. [87])** — total ?; splits: train (-1), test (-1)

## Metrics

- `Test MSE` **(primary)** — range: other
  - Mean squared error between the true and predicted target values (e.g., Hamiltonian or trajectories).
- `relative error` — range: other
  - L2 norm of the difference between true and predicted values divided by the L2 norm of the true values: ||x_true - x_pred||_2 / ||x_true||_2.
- `Train time [s]` — range: seconds
  - Wall-clock time required to complete the training procedure.
- `Speed-up` — range: ratio
  - Ratio of training time of a baseline optimizer to the training time of RF-HGN.

## Input / output format

**Input**: Graph structures representing mass-spring systems, where nodes contain position (q), momentum (p), mass (alpha), and spring constants (beta) in 2D or 3D space.

**Output**: Predicted Hamiltonian values or system trajectories corresponding to the input graph configurations.

## Scoring recipe

```python
def compute_metrics(x_true, x_pred):
    mse = np.mean((x_true - x_pred) ** 2)
    rel_err = np.linalg.norm(x_true - x_pred) / np.linalg.norm(x_true)
    return {'Test MSE': mse, 'relative error': rel_err}
```

## Common pitfalls

- Early stopping was applied to all iterative optimizers, which may conflate convergence speed with final accuracy.
- Hyperparameters were tuned separately for each optimizer rather than using a unified search space, potentially biasing the efficiency comparison.
- Zero-shot generalization fails on 2x2 training systems because they lack nodes with four edges, which are present in larger test grids.

## Evidence (verbatim from paper)

> For $x_{\mathrm{true}}$, $x_{\mathrm{pred}} \in \mathbb{R}^m$ for $m \in \mathbb{N}$, we define the relative error as $||x_{\mathrm{true}} - x_{\mathrm{pred}}||_2 / ||x_{\mathrm{true}}||_2$.

## Citation

```bibtex
@misc{rahma2025rapid,
  title={Rapid training of Hamiltonian graph networks using random features},
  author={Rahma et al. (2025)},
  year={2025},
  note={arXiv:2506.06558}
}
```

- arXiv: 2506.06558

