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
metrics-backendsGuides tslearn metric, backend, autodiff, performance-metric, and barycenter workflows for time-series distance tasks.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when a task needs tslearn distance, similarity, alignment, backend, differentiable-loss, forecasting-error, or barycenter guidance. It is self-contained for the metric APIs; return to the root tslearn router when the task is really about an estimator, data preparation, forecasting, serialization, or another repo workflow.
SoftDTWLossPyTorch.tslearn.metrics.performance (mae, mse, mase) or
tslearn.barycenters (euclidean_barycenter, DBA, Soft-DTW barycenters).Covered here:
tslearn.metrics, including path helpers, cross-distance helpers, masks,
Soft-DTW classes, GAK bandwidth helpers, LCSS, Fréchet, and CTW.tslearn.backend, Backend, NumPyBackend, PyTorchBackend, cast,
instantiate_backend, and backend-selection pitfalls.tslearn.metrics.performance and tslearn.barycenters.SoftDTWLossPyTorch module.Do not use this sub-skill as the owner for:
metric_params:
route fitting, labels, centroids, and model selection to
clustering; only return here for the metric-specific
parameter semantics.tslearn.metrics.performance scoring.be=None
select the NumPy backend and cover ordinary distance matrices, paths,
performance metrics, and barycenters.be="pytorch"; use
SoftDTWLossPyTorch for batched training losses.SoftDTWLossPyTorch still has CPU-side dynamic
programming work.(sz, d)
or (sz,); datasets are (n_ts, sz, d) or compatible lists. Pairwise
metrics require non-empty series and matching feature dimensions.global_constraint="sakoe_chiba" with
sakoe_chiba_radius, or global_constraint="itakura" with
itakura_max_slope; mixed constraint parameters without a global constraint
are a common warning source.Run or adapt scripts/metrics_smoke.py when you need
safe numeric confirmation. It distills the assigned plotting/autodiff examples
into deterministic, no-download subcommands. From the generated tslearn/
skill root, run:
python sub-skills/metrics-backends/scripts/metrics_smoke.py --help
python sub-skills/metrics-backends/scripts/metrics_smoke.py all
python sub-skills/metrics-backends/scripts/metrics_smoke.py dtw --backend numpy
python sub-skills/metrics-backends/scripts/metrics_smoke.py softdtw-loss
The helper is intentionally tiny: it checks representative values and exits non-zero on real failures, but it is not a benchmark and does not prove CUDA acceleration.
dtw, soft_dtw, gak, lcss, frechet, or ctw.*_path helper when alignment
indices matter, and cdist_* for cross-similarity matrices.dtw_path_from_metric,
lcss_path_from_metric, or frechet_path_from_metric, then validate whether
the returned score is a cumulative squared/custom cost rather than a plain
Euclidean distance.requires_grad=True for the tensor being optimized.be="pytorch" or rely on tensor auto-detection; verify the selected
backend from backends if behavior is surprising.soft_dtw or SoftDTWLossPyTorch for training-like workflows;
aggregate the per-example loss before backward().dist_func implementations in torch, returning a
(batch, m, n) distance tensor.euclidean_barycenter only when an arithmetic mean under aligned time
axes is intended.dtw_barycenter_averaging/DBA when alignment under DTW matters; pass
DTW constraints through metric_params.softdtw_barycenter when the smoothing parameter gamma is part of the
model choice; set init or barycenter_size/initialization choices
deliberately when target length matters.