skills/nlp/averaged-meta-embedding/SKILL.md
Element-wise average of multiple pretrained embedding matrices as a parameter-free meta-embedding
npx skillsauth add wenmin-wu/ds-skills nlp-averaged-meta-embeddingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Concatenating embedding matrices (GloVe + Paragram + FastText) doubles or triples the input dimension, inflating model size. An unweighted mean of the matrices — Dynamic Meta Embedding (DME) — preserves the original dimension while combining the semantic signal from each source. It's parameter-free, adds no inference cost, and often performs comparably to weighted blends.
import numpy as np
def load_glove(word_index, embed_size):
# ... returns (vocab_size, embed_size)
...
def load_paragram(word_index, embed_size):
# ... returns (vocab_size, embed_size)
...
embedding_matrix_1 = load_glove(word_index, 300)
embedding_matrix_2 = load_paragram(word_index, 300)
# Unweighted DME: element-wise mean, same shape as inputs
embedding_matrix = np.mean([embedding_matrix_1, embedding_matrix_2], axis=0)
# Shape: (vocab_size, 300) — NOT (vocab_size, 600)
np.mean(..., axis=0) — result has the same shape as each sourceEmbedding layerdata-ai
Scaled Pinball Loss (SPL) metric for evaluating quantile forecasts, normalized by mean absolute successive differences of training data
data-ai
Walk backward through a time series and multiplicatively rescale segments when jumps exceed a fraction of the running mean to correct data collection anomalies
testing
Transform forecasting target to next/current ratio minus one so that optimizing MAE or squared error implicitly minimizes SMAPE
tools
Convert point forecasts to prediction intervals by scaling with logit-transformed quantile ratios passed through a Normal CDF