Skip to content

feat: Add YAML/JSON config system for training and inference#20

Open
KrishanYadav333 wants to merge 1 commit intoML4SCI:mainfrom
KrishanYadav333:feat/config-system-v2
Open

feat: Add YAML/JSON config system for training and inference#20
KrishanYadav333 wants to merge 1 commit intoML4SCI:mainfrom
KrishanYadav333:feat/config-system-v2

Conversation

@KrishanYadav333
Copy link

Pre-GSoC groundwork for the "Denoising Astronomical Observations
of Protoplanetary Disks" project (GSoC 2026).

Started with the config system because everything else — the
U-Net, trainer, inference pipeline — will need a clean way to
load and manage hyperparameters. Felt like the right foundation
to build first before touching any model code.

What's included:

  • A ProjectConfig dataclass that groups all settings (data,
    model, diffusion, training, logging) in one place
  • load_config() that reads YAML or JSON and supports nested
    overrides, so running quick experiments doesn't require
    editing the base config file
  • save_config() to snapshot the exact config used in each run
  • Basic validation with clear error messages for bad inputs
  • 6 unit tests covering all the above — all passing

Files changed:

  • configs/base_config.yaml — default hyperparameters
  • src/training/config.py — schema + load/save logic
  • src/training/__init__.py — clean exports
  • tests/test_config.py — 6 tests

Let me know if anything needs changing!

- Add dataclass-based config schema for project/data/model/diffusion/training/logging
- Add load/save helpers for YAML and JSON
- Add override and validation support for safe config updates
- Add default config file at DENOISING_DIFFUSION/configs/base_config.yaml
- Add unit tests for default load, overrides, JSON/YAML IO, and validation

This PR establishes a small, reusable configuration layer for upcoming
model, scheduler, and trainer implementation PRs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant