Callbacks
Training callbacks for FastGen. All callbacks inherit from Callback and hook into the training lifecycle.
Available Callbacks
Usage
Configure callbacks as a dictionary in the config:
Callbacks run in dictionary order. With model.use_ema set, W&B logs samples from the first EMA network, so place EMA callbacks before wandb (part of BASE_CALLBACKS); otherwise training samples lag by one EMA update.
Predefined configs are in fastgen/configs/callbacks.py.
Lifecycle Hooks
Callbacks can override these hooks:
Custom Callbacks
Callbacks have access to self.config and self.trainer after initialization.
Log Modules
WandbCallback accepts a dict of pluggable LogModule instances via its log_modules arg. Rank 0 runs each module on the cross-rank-gathered List[MediaEntry] per step and forwards any returned loss_dict through scalar aggregation. Subclass LogModule and override process to add your own — see the class docstring for the hook signature.
VLMLogger scores student media with a vision-language model judge served by any OpenAI-compatible endpoint; set VLM_BASE_URL and OPENAI_API_KEY as described in Environment Variables. VipeLogger logs camera trajectories and action overlays for models trained on camera-pose batches. See the module docstrings for media modes, metrics, and options.
Enable them with the presets in fastgen/configs/callbacks.py (VLM_IMG_CALLBACK, VLM_VID_CALLBACK, VIPE_CALLBACK), e.g. config.trainer.callbacks.update(VLM_VID_CALLBACK).