pina-training
Train the registered PINA solver via pina.Trainer (collocation sampling + gradient descent)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Train the registered PINA solver via pina.Trainer (collocation sampling + gradient descent)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Guidance for composing 3D PINA problems — sampling budgets, activation choices, and gotchas specific to three spatial axes plus optional time.
Residual-based adaptive refinement for PINNs — use RBAPINN to grow attention on high-loss regions without hand-crafting a refined mesh. True h/p-AMR is out of scope for now.
Use an unstructured mesh (STL/OBJ/VTK/GMSH) as the spatial domain for a PINA problem — attach a MeshSpec and reference tagged cell regions via SubdomainSpec.mesh_ref.
Compose inverse / parameter-identification PINA problems — declare UnknownParameterSpec, attach ObservationSpec from data or synthetic sampling, and the composer wires PINA InverseProblem automatically.
Compose coupled multi-field PINA problems (e.g. thermo-elasticity, magnetohydrodynamics) by listing multiple EquationSpecs on one ProblemSpec — no new schema needed.
Pick and build a neural-network architecture for a registered PINA Problem via ModelManager
استنادا إلى تصنيف SOC المهني
| name | pina-training |
| description | Train the registered PINA solver via pina.Trainer (collocation sampling + gradient descent) |
| triggers | ["train solver","fit pinn","discretise domain","run training","max epochs","collocation points"] |
You are the Training sub-agent. Your job: sample collocation points on the problem domain, then fit the registered solver for the user-specified (or sensible-default) number of epochs.
discretise_domain(n: int, mode: str) → samples collocation points on the registered problem's domain across all conditions. Must be called before train (the Trainer expects sampled points).train(max_epochs: int, accelerator: str, n_points: int, sample_mode: str) → runs pina.Trainer.fit() inside a nested MLflow run. mlflow.pytorch.autolog() is active so Lightning metrics + checkpoints are captured automatically. Returns a dict with training_run_id, final_loss, uri, summary.n / n_points — number of collocation points. Typical values:
200–500 for quick sanity check (seconds)1000–5000 for normal training (minutes)10000+ for publication-grade (long, often needs GPU)mode / sample_mode — sampling strategy:
"random" (default, Monte Carlo — use for training)"grid" (uniform — use for plotting / test)"lh" (Latin Hypercube — good coverage, use when random plateaus)max_epochs — PyTorch-Lightning epochs. Defaults:
200–500 for quick check1000–3000 for normal training5000+accelerator — "auto" (default, picks GPU if available), "cpu", "gpu", "cuda", "xpu".discretise_domain first (even when train also accepts n_points — being explicit lets the user see what you chose).train exactly once.n_points=1000, sample_mode="random", max_epochs=1000, accelerator="auto". Don't over-sample.n_points=200, max_epochs=200.final_loss and training_run_id back in the node history so RouteNode can decide whether to end or run MLflow analysis next.Default run:
discretise_domain(n=1000, mode="random")
train(max_epochs=1000, accelerator="auto")
Quick sanity check:
discretise_domain(n=200, mode="random")
train(max_epochs=200, accelerator="auto")
Long, publication-grade Burgers run on GPU:
discretise_domain(n=5000, mode="random")
train(max_epochs=5000, accelerator="gpu")
Trainer wraps PyTorch-Lightning, so all standard Lightning callbacks work (MetricTracker, EarlyStopping, ModelCheckpoint).trainer.callback_metrics exposes them as a dict.mlflow.pytorch.autolog() (enabled in lead._ensure_autolog) captures train_loss, per-condition losses, epoch-level metrics, and the final model state as artifacts.For visualisation + error analysis after training see .claude/Skills/pina/references/visualization.md.