train_beat_phase

Core training routine for frame-level beat-phase detection (beat/one/last).

Functions

build_callbacks(cfg)

build_event_metrics_callback(cfg)

Build the event-level validation metrics callback, or None when the config switches it off.

build_module(cfg)

postprocess_knobs(cfg)

Pick the per-task decode blocks out of cfg and return them as plain dicts, which is the form BeatEvaluator indexes.

train(cfg)

build_callbacks(cfg)[source]
Parameters:

cfg (DictConfig)

Return type:

list

build_event_metrics_callback(cfg)[source]

Build the event-level validation metrics callback, or None when the config switches it off.

Off by omission as well as by enabled: false, so a config written before this block existed (or a sweep config trimmed down to essentials) trains exactly as it did before.

Reads the validation refs straight from the split rather than from the validation dataloader: the loader hands out fixed 16-second crops, and these metrics are defined on full tracks.

Parameters:

cfg (DictConfig)

Return type:

EventMetricsLogger | None

build_module(cfg)[source]
Parameters:

cfg (DictConfig)

Return type:

BeatPhaseModule

postprocess_knobs(cfg)[source]

Pick the per-task decode blocks out of cfg and return them as plain dicts, which is the form BeatEvaluator indexes.

This reads; it does not compose. Hydra has already done that by the time it runs: configs/train_phase_beat.yaml lists eval_beat@eval in its defaults:, so the evaluation config is grafted onto cfg.eval while the config is being built. That indirection is the point — the knobs a run scores itself with are the same file tools/eval_beat.py re-scores it with afterwards, rather than a second copy that drifts.

A config that doesn’t compose them yields {}, and every knob then resolves to None — which surfaces as a failed decode, not as quietly different numbers.

Parameters:

cfg (DictConfig)

Return type:

dict

train(cfg)[source]
Parameters:

cfg (DictConfig)

Return type:

None