executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
losses-and-metricsOperate MedicalZooPytorch loss and metric APIs for segmentation criteria, shape contracts, tuple returns, and safe smoke checks.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the task is to select, instantiate, debug, or smoke-test MedicalZooPytorch loss objects exposed through lib.losses3D.
[N, C, D, H, W] and integer label targets shaped [N, D, H, W] unless the API reference says a raw PyTorch loss requires same-shaped targets.classes argument to the model output channel count.criterion(output, target) to return (loss_tensor, per_channel_dice_like). DiceLoss, GeneralizedDiceLoss, BCEDiceLoss, and DiceLoss2D satisfy that shape of contract; scalar-only losses require a trainer adaptation owned by segmentation-workflows.create_loss(name, ...) is case-sensitive and does not expose every constructor option. Instantiate classes directly when class count, skip_index_after, tag coefficients, contrastive embeddings, or 2D Dice behavior matters.Run the bundled deterministic smoke check after making the MedicalZooPytorch package importable:
python sub-skills/losses-and-metrics/scripts/smoke_losses.py
python sub-skills/losses-and-metrics/scripts/smoke_losses.py --cuda
The script uses tiny synthetic tensors, validates tuple versus scalar return contracts, exercises representative factory/manual loss paths, and confirms unsupported factory names fail with guidance.