Back to NumFOCUS
GSoC 2026

Neural Network Builder API Refactor

The sbi (Simulation-Based Inference) library currently constructs neural density estimators via opaque factory functions that accept loose keyword arguments. This design leads to delayed validation errors crashing deep inside PyTorch rather than at configuration, tangles data preprocessing (Z-scoring) with model architecture, and prevents experiment configurations from being serialized, making reproducibility difficult for researchers. This project will refactor the neural network builder infrastructure into a modular, three-tier Layered API. By transitioning to strongly-typed Python dataclasses, the new API will introduce DensityEstimatorBuilder for fail-fast validation and a fully decoupled ZScoreConfig to isolate data standardization. This object-oriented approach ensures that invalid configurations are caught immediately and allows architectures to be easily inspected and saved.

Project details

Contributor

Satwik Sai Prakash Sahoo

Mentors

Not available

Technologies

Not listed in the archive