hrishivish23 commited on
Commit
31620f3
·
verified ·
1 Parent(s): ce26e87

Upload 9 files

Browse files
Files changed (9) hide show
  1. README.md +3 -173
  2. config.json +2 -1
  3. gitattributes +35 -0
  4. model.safetensors +1 -1
  5. optimizer.pt +2 -2
  6. rng_state.pth +1 -1
  7. scheduler.pt +1 -1
  8. trainer_state.json +10 -10
  9. training_args.bin +1 -1
README.md CHANGED
@@ -1,173 +1,3 @@
1
- ---
2
- license: mit
3
- datasets:
4
- - hrishivish23/MPM-Verse-MaterialSim-Small
5
- - hrishivish23/MPM-Verse-MaterialSim-Large
6
- language:
7
- - en
8
- metrics:
9
- - accuracy
10
- pipeline_tag: graph-ml
11
- tags:
12
- - physics
13
- - scientific-ml
14
- - lagrangian-dynamics
15
- - neural-operator
16
- - neural-operator-transformer
17
- - graph-neural-networks
18
- - graph-transformer
19
- - sequence-to-sequence
20
- - autoregressive
21
- - temporal-dynamics
22
- ---
23
-
24
- # 📌 PhysicsEngine: Reduced-Order Neural Operators for Lagrangian Dynamics
25
-
26
- **By [Hrishikesh Viswanath](https://huggingface.co/hrishivish23), Yue Chang, Julius Berner, Peter Yichen Chen, Aniket Bera**
27
-
28
- ![Physics Simulation](https://hrishikeshvish.github.io/projects/giorom_data/giorom_pipeline_plasticine.png)
29
-
30
- ---
31
-
32
- ## 📝 Model Overview
33
- **GIOROM** is a **Reduced-Order Neural Operator Transformer** designed for **Lagrangian dynamics simulations on highly sparse graphs**. The model enables hybrid **Eulerian-Lagrangian learning** by:
34
-
35
- - **Projecting Lagrangian inputs onto uniform grids** with a **Graph-Interaction-Operator**.
36
- - **Predicting acceleration from sparse velocity inputs** using past time windows with a **Neural Operator Transformer**.
37
- - **Learning physics from sparse inputs (n ≪ N)** while allowing reconstruction at arbitrarily dense resolutions via an **Integral Transform Model**.
38
- - **Dataset Compatibility**: This model is compatible with [`MPM-Verse-MaterialSim-Small/Sand3DNCLAWSmall`](https://huggingface.co/datasets/hrishivish23/MPM-Verse-MaterialSim-Small/tree/main/Sand3DNCLAWSmall),
39
-
40
- ⚠ **Note:** While the model can infer using an integral transform, **this repository only provides weights for the time-stepper model that predicts acceleration.**
41
-
42
- ---
43
-
44
- ## 📊 Available Model Variants
45
- Each variant corresponds to a specific dataset, showcasing the reduction in particle count (n: reduced-order, N: full-order).
46
-
47
- | Model Name | n (Reduced) | N (Full) |
48
- |---------------------------------|------------|---------|
49
- | `giorom-3d-t-sand3d-long` | 3.0K | 32K |
50
- | `giorom-3d-t-water3d` | 1.7K | 55K |
51
- | `giorom-3d-t-elasticity` | 2.6K | 78K |
52
- | `giorom-3d-t-plasticine` | 1.1K | 5K |
53
- | `giorom-2d-t-water` | 0.12K | 1K |
54
- | `giorom-2d-t-sand` | 0.3K | 2K |
55
- | `giorom-2d-t-jelly` | 0.2K | 1.9K |
56
- | `giorom-2d-t-multimaterial` | 0.25K | 2K |
57
-
58
- ---
59
-
60
- ## 💡 How It Works
61
-
62
- ### 🔹 Input Representation
63
- The model predicts **acceleration** from past velocity inputs:
64
-
65
- - **Input Shape:** `[n, D, W]`
66
- - `n`: Number of particles (reduced-order, n ≪ N)
67
- - `D`: Dimension (2D or 3D)
68
- - `W`: Time window (past velocity states)
69
-
70
- - **Projected to a uniform latent space** of size `[c^D, D]` where:
71
- - `c ∈ {8, 16, 32}`
72
- - `n - δn ≤ c^D ≤ n + δn`
73
-
74
- This allows the model to generalize physics across different resolutions and discretizations.
75
-
76
- ### 🔹 Prediction & Reconstruction
77
- - The model **learns physical dynamics** on the sparse input representation.
78
- - The **integral transform model** reconstructs dense outputs at arbitrary resolutions (not included in this repo).
79
- - Enables **highly efficient, scalable simulations** without requiring full-resolution training.
80
-
81
- ---
82
-
83
- ## 🚀 Usage Guide
84
- ### 1️⃣ Install Dependencies
85
- ```bash
86
- pip install transformers huggingface_hub torch
87
- ```
88
- ```
89
- git clone https://github.com/HrishikeshVish/GIOROM/
90
- cd GIOROM
91
- ```
92
-
93
-
94
- ### 2️⃣ Load a Model
95
-
96
-
97
-
98
- ```python
99
- from models.giorom3d_T import PhysicsEngine
100
- from models.config import TimeStepperConfig
101
-
102
- time_stepper_config = TimeStepperConfig()
103
-
104
- simulator = PhysicsEngine(time_stepper_config)
105
- repo_id = "hrishivish23/giorom-3d-t-sand3d"
106
- time_stepper_config = time_stepper_config.from_pretrained(repo_id)
107
- simulator = simulator.from_pretrained(repo_id, config=time_stepper_config)
108
- ```
109
-
110
- ### 3️⃣ Run Inference
111
- ```python
112
- import torch
113
-
114
- ```
115
-
116
- ---
117
-
118
- ## 📂 Model Weights and Checkpoints
119
- | Model Name | Model ID |
120
- |---------------------------------|-------------|
121
- | `giorom-3d-t-sand3d-long` | [`hrishivish23/giorom-3d-t-sand3d-long`](https://huggingface.co/hrishivish23/giorom-3d-t-sand3d-long) |
122
- | `giorom-3d-t-water3d` | [`hrishivish23/giorom-3d-t-water3d`](https://huggingface.co/hrishivish23/giorom-3d-t-water3d) |
123
-
124
-
125
- ---
126
-
127
- ## 📚 Training Details
128
- ### 🔧 Hyperparameters
129
- - **Graph Interaction Operator** layers: **4**
130
- - **Transformer Heads**: **4**
131
- - **Embedding Dimension:** **128**
132
- - **Latent Grid Sizes:** `{8×8, 16×16, 32×32}`
133
- - **Learning Rate:** `1e-4`
134
- - **Optimizer:** `Adamax`
135
- - **Loss Function:** `MSE + Physics Regularization (Loss computed on Euler integrated outputs)`
136
- - **Training Steps:** `1M+ steps`
137
-
138
- ### 🖥️ Hardware
139
- - **Trained on:** NVIDIA RTX 3050
140
- - **Batch Size:** `2`
141
-
142
- ---
143
-
144
- ## 📜 Citation
145
- If you use this model, please cite:
146
- ```bibtex
147
- @article{viswanath2024reduced,
148
- title={Reduced-Order Neural Operators: Learning Lagrangian Dynamics on Highly Sparse Graphs},
149
- author={Viswanath, Hrishikesh and Chang, Yue and Berner, Julius and Chen, Peter Yichen and Bera, Aniket},
150
- journal={arXiv preprint arXiv:2407.03925},
151
- year={2024}
152
- }
153
- ```
154
-
155
- ---
156
-
157
- ## 💬 Contact
158
- For questions or collaborations:
159
- - 🧑‍💻 Author: [Hrishikesh Viswanath](https://hrishikeshvish.github.io)
160
- - 📧 Email: [email protected]
161
- - 💬 Hugging Face Discussion: [Model Page](https://huggingface.co/hrishivish23/giorom-3d-t-sand3d-long/discussions)
162
-
163
- ---
164
-
165
- ## 🔗 Related Work
166
- - **Neural Operators for PDEs**: Fourier Neural Operators, Graph Neural Operators
167
- - **Lagrangian Methods**: Material Point Methods, SPH, NCLAW, CROM, LiCROM
168
- - **Physics-Based ML**: PINNs, GNS, MeshGraphNet
169
-
170
- ---
171
-
172
- ### 🔹 Summary
173
- This model is ideal for **fast and scalable physics simulations** where full-resolution computation is infeasible. The reduced-order approach allows **efficient learning on sparse inputs**, with the ability to **reconstruct dense outputs using an integral transform model (not included in this repo).**
 
1
+ ---
2
+ license: mit
3
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
config.json CHANGED
@@ -1,9 +1,10 @@
1
  {
 
2
  "architectures": [
3
  "PhysicsEngine"
4
  ],
5
  "dim": 3,
6
- "gno_radius": 0.165,
7
  "heads": 3,
8
  "hidden_size": 128,
9
  "in_gno_mlp_hidden_layers": [
 
1
  {
2
+ "_name_or_path": "/scratch/gilbreth/hviswan/GIOROM/saved_models/checkpoint-220000",
3
  "architectures": [
4
  "PhysicsEngine"
5
  ],
6
  "dim": 3,
7
+ "gno_radius": 0.125,
8
  "heads": 3,
9
  "hidden_size": 128,
10
  "in_gno_mlp_hidden_layers": [
gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:cbae34bf29e1d2db971aa80ea138ae658c5725a051106ee6157754d8917b3851
3
  size 9568276
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5988486eae82102d817268d65bf13e2c75d158ced00daf4994b1d476e602a52
3
  size 9568276
optimizer.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:59ec1eb13b63796ad34b3fef55cef5056298b124dd60cca8d2e20ae55308cf75
3
- size 19246970
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1eb9785441eb6839ef6303b6d399c399b97af4f9cab8dabb543ae2a7969a29e1
3
+ size 19244538
rng_state.pth CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4083aa1322a231a785325c26497b14a004df92984d3c40f4ec4ece66ac2e9b09
3
  size 14244
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:389769e79f51e0631cb8227739225e60ff3aa16e83c5a4096cd66c07328b42af
3
  size 14244
scheduler.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:60e429bed308f3741637c88d0bd73b051342308591193d374d219af1d4ac4d5d
3
  size 1000
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56f191a7c9a54597391a1acc630adbf0d4ab538406bf0edc4f28d4e9cfd8f5f8
3
  size 1000
trainer_state.json CHANGED
@@ -1,33 +1,33 @@
1
  {
2
  "best_metric": null,
3
  "best_model_checkpoint": null,
4
- "epoch": 15.923566878980893,
5
  "eval_steps": 500,
6
- "global_step": 300000,
7
  "is_hyper_param_search": false,
8
  "is_local_process_zero": true,
9
  "is_world_process_zero": true,
10
  "log_history": [
11
  {
12
- "avg_loss": 0.17167335909317713,
13
- "grad_norm": 0.0,
14
- "learning_rate": 7.585775750096955e-05,
15
- "loss": 0.1428,
16
- "lr": 7.585779243476592e-05,
17
- "step": 299999
18
  }
19
  ],
20
  "logging_steps": 1500,
21
  "max_steps": 37680000,
22
  "num_input_tokens_seen": 0,
23
  "num_train_epochs": 2000,
24
- "save_steps": 100000,
25
  "stateful_callbacks": {
26
  "TrainerControl": {
27
  "args": {
28
  "should_epoch_stop": false,
29
  "should_evaluate": false,
30
- "should_log": true,
31
  "should_save": true,
32
  "should_training_stop": false
33
  },
 
1
  {
2
  "best_metric": null,
3
  "best_model_checkpoint": null,
4
+ "epoch": 11.67728237791932,
5
  "eval_steps": 500,
6
+ "global_step": 220000,
7
  "is_hyper_param_search": false,
8
  "is_local_process_zero": true,
9
  "is_world_process_zero": true,
10
  "log_history": [
11
  {
12
+ "avg_loss": 0.29662682761985026,
13
+ "grad_norm": 32.271949768066406,
14
+ "learning_rate": 6.674212038333604e-05,
15
+ "loss": 0.06960329413414001,
16
+ "lr": 6.668070762644054e-05,
17
+ "step": 219999
18
  }
19
  ],
20
  "logging_steps": 1500,
21
  "max_steps": 37680000,
22
  "num_input_tokens_seen": 0,
23
  "num_train_epochs": 2000,
24
+ "save_steps": 110000,
25
  "stateful_callbacks": {
26
  "TrainerControl": {
27
  "args": {
28
  "should_epoch_stop": false,
29
  "should_evaluate": false,
30
+ "should_log": false,
31
  "should_save": true,
32
  "should_training_stop": false
33
  },
training_args.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1d6b918707d435205378f09b443e0d4952a640bd1a9256371c045e60abfaaf21
3
  size 5240
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b2d5fb1239f85339ec2dac852116c36477743f93287a6bbff77e3c3c2e6e1d0
3
  size 5240