RBF Interpolation with PyTorch

GPU-accelerated Radial Basis Function interpolation for 3D surface reconstruction

Overview

This project provides a PyTorch-based implementation for Radial Basis Function (RBF) interpolation with Gaussian kernels, featuring both standalone scripts and a minimal Dash web interface for interactive visualization.

PyTorch Backend

GPU acceleration for faster computation with automatic CUDA detection and tensor operations.

Parameter Optimization

Automatic cross-validation for nx, ny, sigma parameters to find optimal interpolation settings.

Sampling Points

Interpolate custom sampling coordinates and display as interactive markers on the surface.

3D Visualization

Interactive surface plots with original data points and projection views using Plotly.

Interactive Demo

Below is a live example of the 3D surface interpolation generated by the RBF algorithm:

This plot shows the interpolated surface with original data points and sampling locations marked as black X's.

Quick Start

1. Setup Environment

conda env create -f rbf_interpolation_env.yml
conda activate rbf_interpolation_env

2. Run Interpolation

python interpolate_surface_torch.py

3. Launch Web Interface

python dash_app.py

Navigate to http://localhost:8051 for the interactive interface.

Project Structure

├── interpolate_surface_torch.py # Main interpolation script
├── dash_app.py # Minimal web interface
├── rbf_pytorch.py # PyTorch RBF functions
├── data/
│ ├── surf1.txt # Sample surface data
│ └── sampling_points.txt # Custom sampling coordinates
├── results/ # Generated plots and outputs
└── rbf_interpolation_env.yml # Conda environment

Data Format

Input files: Comma-separated with columns: x,y,z

Sampling points file: x,y coordinates for interpolation