协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
tecoa_text_contrastive_objective【开发与工程】Compute TeCoA image-to-text contrastive logits, loss, margins, and accuracy for robustness recovery.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when image and text embeddings must be scored according to the TeCoA objective. It implements the paper's cross-modal supervision contract: adversarial visual features should align with the correct text embeddings under normalized cosine logits.
Do not use this skill to generate adversarial perturbations or update model parameters. It is a deterministic scoring module consumed by attack and recovery harnesses.
image_embeddings: numeric matrix with shape [batch, dim].text_embeddings: numeric matrix with shape [classes, dim].labels: integer target text index for each image row.temperature: positive scalar, default 0.07.logits: cosine logits divided by temperature.loss: mean image-to-text cross-entropy.accuracy: top-1 image-to-text accuracy.margins: correct logit minus best wrong logit for each row.mean_margin: average margin.Run the tests in tests/test_contrastive_objective.py or the Distiller skill-tree validator with --run-tests.
This skill uses Python standard-library math for portability. It is intended for deterministic reduced/proxy checks and numeric cross-checks, not high-throughput CLIP training.