L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Développement · SKILL.md

training

training

Repository operating skill for Flow Forecast config-driven training, validation, checkpoints, model selection, and light smoke runs.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: training description: "Repository operating skill for Flow Forecast config-driven training, validation, checkpoints, model selection, and light smoke runs." disable-model-invocation: true metadata: disco-role: operating license: GPL 3.0

Training

Use this sub-skill when the task is about fitting, resuming, validating, or debugging Flow Forecast models. It covers the JSON trainer workflow, meta/autoencoder training, loss and optimizer selection, and the data-loader/model-contract details that determine whether a run can start successfully.

Start with:

What This Sub-skill Covers

  • python -m flood_forecast.trainer -p config.json for the main PyTorch and DA-RNN entry path.
  • python -m flood_forecast.meta_train -p config.json for the autoencoder/meta path.
  • PyTorchForecast, train_transformer_style, torch_single_train, compute_validation, and EarlyStopper.
  • The model_dict_function registry, scaling_function, make_criterion_functions, and weight_path / weight_path_add transfer-learning knobs.
  • DA-RNN as a Python-level training workflow using flood_forecast.da_rnn.train_da, not a standalone package CLI; read the troubleshooting caveat before using preprocess_da_rnn.make_data output directly.

What Belongs Elsewhere

  • CSV cleaning, interpolation, datetime normalization, and series grouping belong in data-preparation.
  • Saved-model rollout, inference, evaluation, and plots belong in inference.
  • Catchment encoders, contrastive pretraining, CrossViViT, Neural ODEs, and GR4 hybrid hydrology belong in multimodal-physics.

Typical Workflow

  1. Validate the config with scripts/validate_training_config.py.
  2. Check the model registry and loader contract in references/model-configs.md and references/configuration.md.
  3. Make sure the data-loader class, forecast windows, and loss function match the model family.
  4. Run the smallest safe training path first, usually CPU-only and often with one epoch on a tiny fixture.
  5. Only then scale up to the real dataset or accelerator-backed run.

Operating Notes

  1. For forecasting models, inference_params should usually be present because the trainer evaluates after fitting.
  2. wandb must be False or a mapping; a bare True is not valid because the code reads wandb.get(...).
  3. device: "auto" prefers CUDA, then MPS, then CPU. Explicit cuda or mps requests fail if the backend is missing.
  4. JSON scaler_params are often written with feature_range as a list; the trainer normalizes that to a tuple before constructing the scaler.
  5. GeneralClassificationLoader and VariableSequenceLength follow different validation paths from forecasting loaders, so do not expect the same post-training evaluation flow.

Shared References And Scripts

Non-goals

  • Do not run the full CI training matrix or long benchmark-scale fits by default.
  • Do not require the original checkout for runtime instructions.
  • Do not treat a successful import as proof that the model/config contract is valid.
Skills enregistrées