API Reference
Core Functions
train
pod_rbf.train(snapshot, train_params, config=TrainConfig(), shape_factor=None)
Train POD-RBF model.
Parameters
snapshot : Array Solution snapshots, shape (n_samples, n_snapshots). Each column is a snapshot at a different parameter value. train_params : Array Parameter values, shape (n_snapshots,) or (n_params, n_snapshots). config : TrainConfig Training configuration. shape_factor : float, optional RBF shape parameter. If None, automatically optimized.
Returns
TrainResult Training result containing model state and diagnostics.
inference
pod_rbf.inference(state, inf_params)
Inference trained model at multiple parameter points.
Parameters
state : ModelState Trained model state from train(). inf_params : Array Inference parameters, shape (n_params, n_points) or (n_points,).
Returns
Array Predicted solutions, shape (n_samples, n_points).
inference_single
pod_rbf.inference_single(state, inf_param)
Inference trained model at a single parameter point.
More convenient for gradient computation.
Parameters
state : ModelState Trained model state from train(). inf_param : Array Single inference parameter, scalar or shape (n_params,).
Returns
Array Predicted solution, shape (n_samples,).
I/O Functions
build_snapshot_matrix
pod_rbf.build_snapshot_matrix(dirpath, skiprows=1, usecols=0, verbose=True)
Load snapshot matrix from CSV files in directory.
Files are loaded in alphanumeric order. Ensure parameter array matches this ordering.
Parameters
dirpath : str Directory containing CSV files. skiprows : int Number of header rows to skip in each file. usecols : int or tuple Column(s) to read from each file. verbose : bool Show progress bar.
Returns
np.ndarray Snapshot matrix, shape (n_samples, n_snapshots). Returns NumPy array - convert to JAX as needed.
save_model
pod_rbf.save_model(filename, state)
Save model state to file.
Parameters
filename : str Output filename. state : ModelState Trained model state.
load_model
pod_rbf.load_model(filename)
Load model state from file.
Parameters
filename : str Input filename.
Returns
ModelState Loaded model state with JAX arrays.
Types
TrainConfig
pod_rbf.TrainConfig
Bases: NamedTuple
Immutable training configuration.
ModelState
pod_rbf.ModelState
Bases: NamedTuple
Immutable trained model state - a valid JAX pytree.
TrainResult
pod_rbf.TrainResult
Bases: NamedTuple
Result from training, includes diagnostics.