Pooyash1998 commited on
Commit
8085015
Β·
1 Parent(s): 881b594

polish README, viewer header, minor cleanups

Browse files
.gitignore CHANGED
@@ -84,5 +84,6 @@ tensorboard/
84
 
85
  # ── misc ────────────────────────────────────────────────────────────────
86
  CLAUDE.md
 
87
  docs/*
88
  docs/
 
84
 
85
  # ── misc ────────────────────────────────────────────────────────────────
86
  CLAUDE.md
87
+ .claude
88
  docs/*
89
  docs/
README.md CHANGED
@@ -2,7 +2,7 @@
2
 
3
  Reconstruct a continuous 3D sound pressure field from sparse microphone measurements, with the Helmholtz wave equation enforced as a hard constraint during training.
4
 
5
- **Apple M4 Pro Β· No cloud GPU**
6
 
7
  ---
8
 
@@ -123,11 +123,11 @@ where Ξ² = 0.4 is the specific admittance (absorption coefficient).
123
 
124
  ## Key Implementation Decisions
125
 
126
- **SIREN activations (Ο‰β‚€=1.0, not 30):** Sine activations give smooth second derivatives β€” critical for the Laplacian computation. Ο‰β‚€=30 was tested but caused the physics loss to blow up (second derivatives O(1e9) with 8 stacked layers). Lowered to 1.0 since positional encoding already handles high frequencies.
127
 
128
  **Finite difference Laplacian:** PyTorch autograd `create_graph=True` is unstable on MPS for second derivatives. Central differences with h=5e-3 give residual error ~0.05 on plane waves (acceptable). Coordinate scaling: multiply each dimension's contribution by (2/L_dim)Β² to convert from normalized to physical metres.
129
 
130
- **2000 microphones:** The model with 128 mics produced visually noisy fields despite good physics metrics β€” 99.9% Helmholtz residual reduction but no visible wave structure. Root cause: ~800:1 param-to-data ratio. pyroomacoustics computes all mic RIRs in a single call regardless of count (128 mics β†’ 2000 mics costs 1.2s extra). 2000 mics Γ— 4 frequencies = 8000 samples drops the ratio to ~62:1 and produces clear wave rings.
131
 
132
  ---
133
 
@@ -158,4 +158,4 @@ docs/ raw_log.md, article_draft.md
158
 
159
  ---
160
 
161
- *Pooya Esfahani Β· M4 Pro Β· April 2026*
 
2
 
3
  Reconstruct a continuous 3D sound pressure field from sparse microphone measurements, with the Helmholtz wave equation enforced as a hard constraint during training.
4
 
5
+ On **Apple M4 Pro (48GB VRam) Β· No cloud GPU**
6
 
7
  ---
8
 
 
123
 
124
  ## Key Implementation Decisions
125
 
126
+ **SIREN activations (Ο‰β‚€=1.0, not 30):** Sine activations give smooth second derivatives, critical for the Laplacian computation. Ο‰β‚€=30 was tested but caused the physics loss to blow up (second derivatives O(1e9) with 8 stacked layers). Lowered to 1.0 since positional encoding already handles high frequencies.
127
 
128
  **Finite difference Laplacian:** PyTorch autograd `create_graph=True` is unstable on MPS for second derivatives. Central differences with h=5e-3 give residual error ~0.05 on plane waves (acceptable). Coordinate scaling: multiply each dimension's contribution by (2/L_dim)Β² to convert from normalized to physical metres.
129
 
130
+ **2000 microphones:** The model with 128 mics produced visually noisy fields despite good physics metrics. *99.9%* Helmholtz residual reduction but no visible wave structure. Root cause: ~800:1 param-to-data ratio. pyroomacoustics computes all mic RIRs in a single call regardless of count (128 mics β†’ 2000 mics costs 1.2s extra). 2000 mics Γ— 4 frequencies = 8000 samples drops the ratio to ~62:1 and produces clear wave rings.
131
 
132
  ---
133
 
 
158
 
159
  ---
160
 
161
+ *Pooya Esfahani - April 2026*
src/api/main.py CHANGED
@@ -23,7 +23,7 @@ from src.data.generate_synthetic import generate_room_data
23
  from src.visualization.export import export_field, DEFAULT_CFG, ROOM_DIMS, SOURCE_POS, FREQUENCIES
24
  from src.physics.helmholtz import helmholtz_residual_fd
25
 
26
- # ── Global state ──────────────────────────────────────────────────────────────
27
 
28
  STATE = {}
29
 
@@ -76,7 +76,7 @@ app.add_middleware(
76
  app.mount("/viewer", StaticFiles(directory="viewer", html=True), name="viewer")
77
 
78
 
79
- # ── Routes ────────────────────────────────────────────────────────────────────
80
 
81
  @app.get("/")
82
  def root():
 
23
  from src.visualization.export import export_field, DEFAULT_CFG, ROOM_DIMS, SOURCE_POS, FREQUENCIES
24
  from src.physics.helmholtz import helmholtz_residual_fd
25
 
26
+ # Global state
27
 
28
  STATE = {}
29
 
 
76
  app.mount("/viewer", StaticFiles(directory="viewer", html=True), name="viewer")
77
 
78
 
79
+ #Routes
80
 
81
  @app.get("/")
82
  def root():
src/data/generate_synthetic.py CHANGED
@@ -1,7 +1,5 @@
1
  """
2
  Synthetic room acoustic data generation using pyroomacoustics.
3
- Produces complex pressure measurements at sparse microphone positions
4
- and dense ground-truth grids for validation.
5
  """
6
 
7
  import numpy as np
 
1
  """
2
  Synthetic room acoustic data generation using pyroomacoustics.
 
 
3
  """
4
 
5
  import numpy as np
viewer/index.html CHANGED
@@ -150,7 +150,8 @@
150
 
151
  <script>
152
  (async () => {
153
- const isLocal = !window.location.hostname || window.location.hostname === '';
 
154
  const fieldUrl = isLocal ? 'field_data.json' : '/viewer/field_data.json';
155
 
156
  let pct = 0;
 
150
 
151
  <script>
152
  (async () => {
153
+ const h = window.location.hostname;
154
+ const isLocal = !h || h === '' || h === 'localhost' || h === '127.0.0.1';
155
  const fieldUrl = isLocal ? 'field_data.json' : '/viewer/field_data.json';
156
 
157
  let pct = 0;