计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
training-evaluation【效率与协作】Use segmentation_models_pytorch losses, metrics, tensor modes, and safe training/evaluation loops for segmentation.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when an agent needs to train or evaluate segmentation with segmentation_models_pytorch (SMP) losses and metrics, diagnose mask/logit shape errors, or adapt a short training loop without downloads or long-running training.
DiceLoss, JaccardLoss, TverskyLoss, FocalLoss, LovaszLoss, SoftBCEWithLogitsLoss, SoftCrossEntropyLoss, or MCCLoss.BINARY_MODE, MULTICLASS_MODE, and MULTILABEL_MODE for logits, masks, losses, and metrics.smp.metrics.get_stats followed by iou_score, f1_score, accuracy, precision, or recall.from_logits, ignore_index, or class_weights failures.classes, in_channels, decoder options, or smp.create_model in model-building.(N, 1, H, W) and target masks are 0/1, preferably (N, 1, H, W) for metrics and either (N, H, W) or (N, 1, H, W) for most losses.(N, C, H, W), target is integer class ids (N, H, W), and classes are mutually exclusive.(N, C, H, W), each channel is an independent 0/1 label, and classes may overlap.from_logits=True; metrics consume hard integer masks or floating binary/multilabel scores plus a threshold.Run the bundled validator before changing a real loop:
python sub-skills/training-evaluation/scripts/validate_training_shapes.py --mode binary --batch 2 --classes 1 --height 8 --width 8 --from-logits --metric-threshold 0.5
python sub-skills/training-evaluation/scripts/validate_training_shapes.py --mode multiclass --classes 3 --loss soft-ce
python sub-skills/training-evaluation/scripts/validate_training_shapes.py --mode multilabel --classes 4 --metric-threshold 0.5
The helper constructs tiny tensors only; it does not download data, build a model, or train.