How simonzeng7108/rbf-pinn works
Project Type and Purpose
• This is an open-source scientific framework (“RBF-PINN”) for enhancing Physics-Informed Neural Networks with a Radial Basis Function (RBF) feature-mapping layer.
• It provides nine canonical PDE experiments (Wave 1D, Diffusion 1D, Heat2d multiscale, Poisson 2D, Burgers 1D, Steady NS, Inverse Burgers, Inverse Lorenz, Poisson Nd) plus ablation studies under “Ablation study/…”.
File-Structure Analysis
• Top-level directories:
• 1_Wave_1D … 9_PoissonNd – each directory is a self-contained experiment.
• Ablation study/… – nested copies of experiments for compact-support and surjectivity ablations.
• Figs (figures), README.md.
• data/ (raw PDE data files)
• dataset.py (data loader & sampling)
• RBF_kernels.py + Utils.py (preprocessing, feature-mapping functions)
• network.py (PINN architecture with feature-mapping layer)
• trainer.py (training loop, PINN residual & boundary losses)
• main.py (CLI/script entry point tying all components)
• plot_*.py (visualization)
• logs/models/ (serialized PyTorch models)
• results/ (metrics, error analyses, PDFs)
Core Components
a. Data Layer
– PDE data files → dataset.py (sampling collocation, boundary points)
b. Preprocessing & Feature Mapping
– Utils.py, RBF_kernels.py → compute RBF feature‐map of coordinates
c. Neural Network (PINN)
– network.py defines feed-forward NN + feature mapping layer
d. Training Engine
– trainer.py sets up loss (physics residual + data/inverse losses), optimizer, epoch loop
e. Orchestration & CLI
– main.py parses config/args, instantiates Data → Model → Trainer, triggers training
f. Logging & Persistence
– logs/models/*.pt
– optional logs/loss.pkl, running_result.txt (in ablation)
g. Results & Visualization
– results/ (plots, numeric summaries)
– plot_*.py generates figures from trained models
Interactions & Data Flow
• Data files → dataset → (sampled batches) → feature mapping → forward pass in network
• Network outputs → residual/loss computed in trainer → backprop → updated network → logs/model checkpoints
• After training completes (or per epoch), logs are written, and plot_*.py or main.py post-processing dumps results into results/.
• Ablation studies reuse the same pipeline but swap or extend RBF_kernels.py or network hyperparameters.
Architectural Patterns & Design Principles
• Modular “experiment‐per‐directory” pattern: each PDE problem is a plug-and-play module conforming to the same interface.
• Pipeline pattern: Data → Preprocessing → Model → Trainer → Logger → Visualizer.
• Extensibility: new PDE cases or feature mappings can be added by copying one directory template.
• Separation of concerns: data loading, feature mapping, model definition, training logic, and visualization are all decoupled.
External Dependencies & Technologies
• PyTorch (torch==2.0)
• Numpy, Matplotlib
• pyDOE (for sampling if used)
• torchsummary for model introspection
Final Checklist
• [ ] Annotations for key libraries (PyTorch, Numpy, etc.)
• [ ] Collapsed view for “nine experiment modules” plus one “ablation” module