Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
351f562
feat: generalise dataset split definitions
leifdenby May 19, 2026
a529899
fix: require explicit fraction-based test splits
leifdenby May 19, 2026
efae80d
refactor: log split summary during datamodule setup
leifdenby May 19, 2026
174ad6e
fix: make datamodule setup stage-aware
leifdenby May 19, 2026
036c4d1
fix: cast source dataset samples to float32
leifdenby May 20, 2026
4988226
fix: scope data gitignore pattern to repo root
leifdenby May 20, 2026
6daca17
Merge branch 'bugfix/cast-float64' into dev
leifdenby May 20, 2026
49cec16
Merge branch 'refactor/more-flexible-dataset-splits' into dev
leifdenby May 20, 2026
df028fe
docs: add ldcast refactor plan
leifdenby May 20, 2026
8f3ce10
docs: update ldcast refactor plan
leifdenby May 20, 2026
11dd3a5
refactor: require explicit convgru config selection
leifdenby May 20, 2026
85df9de
refactor: introduce sequence-first data layer
leifdenby May 20, 2026
2c2ea19
feat: add autoencoder architecture
leifdenby May 20, 2026
bc415aa
docs: mark autoencoder plan complete
leifdenby May 20, 2026
10b6b9a
refactor: fix forecasting model shape contract
leifdenby May 20, 2026
4b28741
docs: clarify deterministic halfunet example
leifdenby May 20, 2026
36bb8dc
feat: add latent diffusion architecture
leifdenby Jun 3, 2026
a4701c3
refactor: split forecasting task modules
leifdenby Jun 3, 2026
c19cc51
refactor: clarify forecasting task module roles
leifdenby Jun 3, 2026
9371fca
refactor: remove obsolete module aliases
leifdenby Jun 3, 2026
6d67659
feat: add LDCast two-stage training experiment
leifdenby Jun 3, 2026
9363c04
docs: add LDCast architecture docs, config diagram, and implementatio…
leifdenby Jun 3, 2026
2599f17
refactor: add explicit ensemble dimension throughout forecasting pipe…
leifdenby Jun 3, 2026
7060f55
refactor: use einops rearrange for ensemble unstack in LatentDiffusio…
leifdenby Jun 3, 2026
f4115f8
refactor: make fiddlers apply recursively to nested Experiment configs
leifdenby Jun 3, 2026
4d3574a
refactor: move archetype experiments to mlcast.config.archetype subpa…
leifdenby Jun 3, 2026
74f6852
Merge branch 'main' of https://github.com/mlcast-community/mlcast int…
leifdenby Jun 3, 2026
c5b56ee
fix: resolve test failures and align metric naming for LDCast merge
leifdenby Jun 3, 2026
5a01f5c
docs: add ldcast-notes.md documenting DMI/Martinbo implementation dif…
leifdenby Jun 3, 2026
b1241d5
refactor: align LDCast config with DMI/Martinbo reference
leifdenby Jun 3, 2026
8990c47
docs: explain why EMA is used for latent diffusion in docstring
leifdenby Jun 3, 2026
2d151a7
docs: simplify LDCast README snippet — single use_random_sampler(cfg)…
leifdenby Jun 3, 2026
75a54be
docs: fix HalfUNet example jaxtyping, einops, and ensemble dim
leifdenby Jun 3, 2026
3e48d33
docs: update plan — mark section 8 complete, add future work section 9
leifdenby Jun 4, 2026
9b207e7
refactor: rename LDCast to latent_diffusion to reflect simplified scope
leifdenby Jun 4, 2026
79854fa
fix typo in readme
leifdenby Jun 4, 2026
e0d786c
ci: install graphviz for config diagram pre-commit hooks
leifdenby Jun 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
with:
enable-cache: true

# The config-diagram-* hooks require the `dot` binary from graphviz.
- name: Install graphviz
run: sudo apt-get update && sudo apt-get install -y graphviz

# Run pre-commit through uv so CI uses the same project-managed environment
# as local development, including local hooks that invoke `uv run ...`.
- run: uv run pre-commit run --all-files
12 changes: 9 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ repos:
- id: pyproject-fmt
- repo: local
hooks:
- id: config-diagram
name: config diagram up to date
- id: config-diagram-convgru
name: convgru config diagram up to date
language: system
entry: uv run python docs/generate_base_experiment_config_diagram.py --check
files: ^src/mlcast/config/base\.py$
files: ^src/mlcast/config/(base|archetype/convgru)\.py$
pass_filenames: false
- id: config-diagram-latent-diffusion
name: latent diffusion config diagram up to date
language: system
entry: uv run python docs/generate_latent_diffusion_config_diagram.py --check
files: ^src/mlcast/config/archetype/latent_diffusion\.py$
pass_filenames: false
ci:
autoupdate_schedule: monthly
Expand Down
14 changes: 14 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ Guidelines for contributors and AI agents working on this codebase.

- Use `loguru` exclusively. Do not use the stdlib `logging` module.

## Metric naming

- Logged metric names follow TensorBoard conventions: use `/` as a hierarchy
separator (e.g. `val/loss`, `train/rec_loss`) so that related metrics are
grouped in the TensorBoard UI.
- Use `rec_loss` for reconstruction-stage metrics and `loss` for
forecasting/diffusion-stage metrics to make clear which training stage a
metric belongs to.
- Metric name format: `{split}/{name}` where `split` is `train`, `val`, or
`test`.
- Monitoring references in config files (ModelCheckpoint, EarlyStopping,
lr_scheduler) must match the `val/{name}` variant of the metric they should
track.

## Code style

- Docstrings follow NumPy style.
Expand Down
287 changes: 231 additions & 56 deletions README.md

Large diffs are not rendered by default.

683 changes: 349 additions & 334 deletions docs/config_diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/generate_base_experiment_config_diagram.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Generate a Graphviz SVG diagram of the default training_experiment config.
"""Generate a Graphviz SVG diagram of the included ConvGRU training config.

Run without arguments to regenerate docs/config_diagram.svg:

Expand All @@ -15,13 +15,13 @@

import fiddle.graphviz as fgv

from mlcast.config import training_experiment
from mlcast.config import convgru_training_experiment

OUT = Path(__file__).parent / "config_diagram.svg"


def main() -> None:
"""Generate or verify the base experiment config diagram."""
"""Generate or verify the ConvGRU training config diagram."""
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--check",
Expand All @@ -30,7 +30,7 @@ def main() -> None:
)
args = parser.parse_args()

cfg = training_experiment.as_buildable()
cfg = convgru_training_experiment.as_buildable()
g = fgv.render(cfg, max_str_length=40)
g.format = "svg"
new_svg = g.pipe().decode()
Expand Down
52 changes: 52 additions & 0 deletions docs/generate_latent_diffusion_config_diagram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""Generate a Graphviz SVG diagram of the included latent diffusion training config.

Run without arguments to regenerate docs/latent_diffusion_config_diagram.svg:

uv run python docs/generate_latent_diffusion_config_diagram.py

Run with --check to verify the diagram is up to date:

uv run python docs/generate_latent_diffusion_config_diagram.py --check
"""

import argparse
import sys
from pathlib import Path

import fiddle.graphviz as fgv

from mlcast.config import latent_diffusion_experiment

OUT = Path(__file__).parent / "latent_diffusion_config_diagram.svg"


def main() -> None:
"""Generate or verify the latent diffusion training config diagram."""
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--check",
action="store_true",
help="Check that the diagram is up to date rather than regenerating it.",
)
args = parser.parse_args()

cfg = latent_diffusion_experiment.as_buildable()
g = fgv.render(cfg, max_str_length=40)
g.format = "svg"
new_svg = g.pipe().decode()

if args.check:
if not OUT.exists() or OUT.read_text() != new_svg:
print(
"docs/latent_diffusion_config_diagram.svg is out of date.\n"
"Run: uv run python docs/generate_latent_diffusion_config_diagram.py"
)
sys.exit(1)
print("docs/latent_diffusion_config_diagram.svg is up to date.")
else:
OUT.write_text(new_svg)
print(f"Written {OUT}")


if __name__ == "__main__":
main()
Loading
Loading