siamese_from_correlation_matrix

Train siamese models from embedding correlation matrices without external labels.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/thistleknot/skills --skill siamese-from-correlation-matrix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: siamese_from_correlation_matrix
Source: https://github.com/thistleknot/skills/tree/main/siamese_from_correlation_matrix
Command: npx skills add https://github.com/thistleknot/skills --skill siamese-from-correlation-matrix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Derives training signals for siamese or metric-learning models directly from an embedding correlation matrix, eliminating the need for external labels.

Core Features & Use Cases

  • Correlation-to-training target generation: Converts an N×N correlation matrix (e.g., cosine/dot-product structure) into regression-style targets for pairwise similarity learning.
  • Structure-aware hybrid supervision: Augments correlation regression with cluster membership signals (e.g., GMM/HDBSCAN) and decorrelation-based boundary/ordinal guidance.
  • Model refinement and interpretability: Produces a refined embedding space and supports integrated visualization (sorted correlation heatmaps, embedding clouds, and distribution plots) to verify learned structure.

Quick Start

Use siamese_from_correlation_matrix to train a contrastive/metric-learning model from a pre-computed embedding correlation matrix you already have, and generate a refined embedding model that preserves correlation and cluster structure.

Frequently Asked Questions about siamese_from_correlation_matrix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train a siamese network without external labels?

Training a siamese network without external labels is achievable by deriving pairwise similarity targets directly from a pre-computed embedding correlation matrix. This matrix acts as the supervision signal, replacing labeled data for contrastive or metric-learning training.

What is correlation-based metric learning for unlabeled embeddings?

Correlation-based metric learning transforms an existing embedding correlation matrix into hybrid supervision targets for pairwise similarity learning. It applies structure-aware signals like cluster memberships and decorrelation-based ordering to refine embeddings without external labels.

Can I use cluster membership to improve contrastive training targets?

Yes, you can integrate clustering algorithms like GMM or HDBSCAN over embeddings to generate structure-aware hybrid supervision targets. These cluster membership signals augment correlation regression to guide contrastive training and preserve structural relationships.

How do I generate hard example weights for metric learning?

Hard example weighting is generated by applying decorrelation-based ordering to the embedding correlation matrix. This creates boundary and ordinal guidance that identifies challenging pairs, prioritizing them during siamese loss calculation to align predicted relations with empirical correlations.

Does this approach work for cross-instance representation refinement in audio and text?

Yes, this approach supports cross-instance representation refinement across audio, text, and image domains. It applies contrastive and regression-on-similarity training to refine embeddings wherever an empirical correlation matrix can be computed.

What are the limitations of using a correlation matrix for siamese training?

A primary limitation is the absolute requirement for a pre-computed N×N embedding correlation matrix, making it unsuitable if no initial embeddings exist. It also requires computing clustering and decorrelation signals, adding overhead before siamese loss alignment can begin.