Jacob Garcia · Hugging Face Model Foundry

Turing Neural Field

Interactive physics-versus-neural morphogenesis comparison. This showcase backs up the trained artifacts, measured evaluation, and complete runnable source.

Explore every file View the full foundry

Verified project card

# Turing Neural Field

Turing Neural Field learns the local dynamics of a Gray–Scott reaction-diffusion
system. A compact circular-convolution network receives the two chemical fields plus
feed and kill parameters, then predicts one physical update.

Evaluation separates trajectories by ID so test states never appear in training. The
project compares one-step error with a no-change baseline and rolls the learned
surrogate forward beside the numerical simulator.

## Reproduce

```powershell
uv run python projects/turing-neural-field/generate_data.py
uv run python projects/turing-neural-field/train.py
```

The generated GIF and Gradio comparison app show actual model rollouts. The simulator
is still the source of truth; the neural field is an approximation.

## Verified results

- Parameters: **15,090**
- Training trajectories: **28**
- Validation trajectories: **4**
- Test trajectories: **4**
- Held-out one-step states: **160**
- Neural one-step MSE: **1.115 × 10⁻⁶**
- No-change baseline MSE: **1.699 × 10⁻⁶**
- One-step improvement: **34.37%**
- 120-step final field MSE: **0.00414**
- 120-step V-field correlation: **0.606**

At step 120, physics had V-field mean 0.0169 and spatial standard deviation 0.0662;
the surrogate produced 0.0128 and 0.0458. The learned rollout preserves the central
ring topology but underestimates its radius and contrast. The final comparison PNG,
animated GIF, and working Space app expose that drift directly.

Evaluation snapshot

{
  "model": "Turing Neural Field Rollout-Tuned",
  "parameters": 15090,
  "rollout_finetune_best_epoch": 0,
  "validation_12_step_mse": {
    "before": 5.9150930610485375e-05,
    "after": 5.9150930610485375e-05,
    "improvement_percent": 0.0
  },
  "one_step_test_after_finetune": {
    "model_mse": 1.1151045100632473e-06,
    "persistence_mse": 1.699125959930825e-06,
    "improvement_percent": 34.37187493100008
  },
  "held_out_120_step_rollout": {
    "before": {
      "steps": 120,
      "final_field_mse": 0.004136570263653994,
      "v_field_correlation": 0.6055178642272949,
      "physics_v_mean": 0.01694415509700775,
      "neural_v_mean": 0.012777323834598064,
      "physics_v_spatial_std": 0.06622135639190674,
      "neural_v_spatial_std": 0.04577188193798065
    },
    "after": {
      "steps": 120,
      "final_field_mse": 0.004136570263653994,
      "v_field_correlation": 0.6055178642272949,
      "physics_v_mean": 0.01694415509700775,
      "neural_v_mean": 0.012777323834598064,
      "physics_v_spatial_std": 0.06622135639190674,
      "neural_v_spatial_std": 0.04577188193798065
    }
  },
  "gif_layout": "left physics simulator, right rollout-tuned neural surrogate"
}

Backed-up artifact tree

  • README.md
  • __pycache__/app.cpython-311.pyc
  • __pycache__/model.cpython-311.pyc
  • __pycache__/physics.cpython-311.pyc
  • __pycache__/train.cpython-311.pyc
  • app.py
  • artifacts/turing-neural-field/evaluation.json
  • artifacts/turing-neural-field/final_comparison.png
  • artifacts/turing-neural-field/model-one-step.safetensors
  • artifacts/turing-neural-field/model.safetensors
  • artifacts/turing-neural-field/physics_vs_neural.gif
  • data/gray_scott_trajectories.npz
  • data/manifest.json
  • finetune_rollout.py
  • generate_data.py
  • model.py
  • physics.py
  • render_saved.py
  • requirements.txt
  • train.py