File size: 6,103 Bytes
748411e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
---
license: mit
datasets:
- hrishivish23/MPM-Verse-MaterialSim-Small
- hrishivish23/MPM-Verse-MaterialSim-Large
language:
- en
metrics:
- accuracy
pipeline_tag: graph-ml
tags:
- physics
- scientific-ml
- lagrangian-dynamics
- neural-operator
- neural-operator-transformer
- graph-neural-networks
- graph-transformer
- sequence-to-sequence
- autoregressive
- temporal-dynamics
---

# πŸ“Œ PhysicsEngine: Reduced-Order Neural Operators for Lagrangian Dynamics

**By [Hrishikesh Viswanath](https://huggingface.co/hrishivish23), Yue Chang, Julius Berner, Peter Yichen Chen, Aniket Bera**  

![Physics Simulation](https://hrishikeshvish.github.io/projects/giorom_data/giorom_pipeline_plasticine.png)

---

## πŸ“ Model Overview  
**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:  

- **Projecting Lagrangian inputs onto uniform grids** with a **Graph-Interaction-Operator**.  
- **Predicting acceleration from sparse velocity inputs** using past time windows with a **Neural Operator Transformer**.  
- **Learning physics from sparse inputs (n β‰ͺ N)** while allowing reconstruction at arbitrarily dense resolutions via an **Integral Transform Model**.
- **Dataset Compatibility**: This model is compatible with [`MPM-Verse-MaterialSim-Small/Elasticity3DSmall`](https://huggingface.co/datasets/hrishivish23/MPM-Verse-MaterialSim-Small/tree/main/Elasticity3DSmall), 

⚠ **Note:** While the model can infer using an integral transform, **this repository only provides weights for the time-stepper model that predicts acceleration.**

---

## πŸ“Š Available Model Variants  
Each variant corresponds to a specific dataset, showcasing the reduction in particle count (n: reduced-order, N: full-order).  

| Model Name                     | n (Reduced) | N (Full) |
|---------------------------------|------------|---------|
| `giorom-3d-t-sand3d-long`       | 3.0K       | 32K     |
| `giorom-3d-t-water3d`           | 1.7K       | 55K     |
| `giorom-3d-t-elasticity`        | 2.6K       | 78K     |
| `giorom-3d-t-plasticine`        | 1.1K       | 5K      |
| `giorom-2d-t-water`             | 0.12K      | 1K      |
| `giorom-2d-t-sand`              | 0.3K       | 2K      |
| `giorom-2d-t-jelly`             | 0.2K       | 1.9K    |
| `giorom-2d-t-multimaterial`     | 0.25K      | 2K      |

---

## πŸ’‘ How It Works  

### πŸ”Ή Input Representation  
The model predicts **acceleration** from past velocity inputs:  

- **Input Shape:** `[n, D, W]`  
  - `n`: Number of particles (reduced-order, n β‰ͺ N)  
  - `D`: Dimension (2D or 3D)  
  - `W`: Time window (past velocity states)  

- **Projected to a uniform latent space** of size `[c^D, D]` where:  
  - `c ∈ {8, 16, 32}`  
  - `n - Ξ΄n ≀ c^D ≀ n + Ξ΄n`  

This allows the model to generalize physics across different resolutions and discretizations.  

### πŸ”Ή Prediction & Reconstruction  
- The model **learns physical dynamics** on the sparse input representation.  
- The **integral transform model** reconstructs dense outputs at arbitrary resolutions (not included in this repo).  
- Enables **highly efficient, scalable simulations** without requiring full-resolution training.

---

## πŸš€ Usage Guide  
### 1️⃣ Install Dependencies
```bash
pip install transformers huggingface_hub torch
```
```
git clone https://github.com/HrishikeshVish/GIOROM/
cd GIOROM
```


### 2️⃣ Load a Model



```python
from models.giorom3d_T import PhysicsEngine
from models.config import TimeStepperConfig

time_stepper_config = TimeStepperConfig()

simulator = PhysicsEngine(time_stepper_config)
repo_id = "hrishivish23/giorom-3d-t-sand3d"
time_stepper_config = time_stepper_config.from_pretrained(repo_id)
simulator = simulator.from_pretrained(repo_id, config=time_stepper_config)
```

### 3️⃣ Run Inference
```python
import torch

```

---

## πŸ“‚ Model Weights and Checkpoints  
| Model Name                     | Model ID |
|---------------------------------|-------------|
| `giorom-3d-t-sand3d-long`            | [`hrishivish23/giorom-3d-t-sand3d-long`](https://huggingface.co/hrishivish23/giorom-3d-t-sand3d-long) |
| `giorom-3d-t-water3d`           | [`hrishivish23/giorom-3d-t-water3d`](https://huggingface.co/hrishivish23/giorom-3d-t-water3d) |


---

## πŸ“š Training Details  
### πŸ”§ Hyperparameters  
- **Graph Interaction Operator** layers: **4**
- **Transformer Heads**: **4**
- **Embedding Dimension:** **128**  
- **Latent Grid Sizes:** `{8Γ—8, 16Γ—16, 32Γ—32}`  
- **Learning Rate:** `1e-4`  
- **Optimizer:** `Adamax`  
- **Loss Function:** `MSE + Physics Regularization (Loss computed on Euler integrated outputs)`  
- **Training Steps:** `1M+ steps`  

### πŸ–₯️ Hardware  
- **Trained on:** NVIDIA RTX 3050
- **Batch Size:** `2`  

---

## πŸ“œ Citation  
If you use this model, please cite:
```bibtex
@article{viswanath2024reduced,
  title={Reduced-Order Neural Operators: Learning Lagrangian Dynamics on Highly Sparse Graphs},
  author={Viswanath, Hrishikesh and Chang, Yue and Berner, Julius and Chen, Peter Yichen and Bera, Aniket},
  journal={arXiv preprint arXiv:2407.03925},
  year={2024}
}
```

---

## πŸ’¬ Contact  
For questions or collaborations:  
- πŸ§‘β€πŸ’» Author: [Hrishikesh Viswanath](https://hrishikeshvish.github.io)  
- πŸ“§ Email: [email protected] 
- πŸ’¬ Hugging Face Discussion: [Model Page](https://huggingface.co/hrishivish23/giorom-3d-t-sand3d-long/discussions)  

---

## πŸ”— Related Work  
- **Neural Operators for PDEs**: Fourier Neural Operators, Graph Neural Operators  
- **Lagrangian Methods**: Material Point Methods, SPH, NCLAW, CROM, LiCROM
- **Physics-Based ML**: PINNs, GNS, MeshGraphNet

---

### πŸ”Ή Summary  
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).**