인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
생산성 및 협업 · SKILL.md

cross_attention_conditioning

cross_attention_conditioning

Validate and run deterministic LDM-style cross-attention conditioning between latent features and modality tokens.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: cross_attention_conditioning description: Validate and run deterministic LDM-style cross-attention conditioning between latent features and modality tokens.

Cross-Attention Conditioning

Use this skill when an LDM experiment must prove that conditioning tokens influence latent denoising features through cross-attention. It is suitable for reduced recovery, shape checks, and prompt/conditioning module tests. Do not use it to choose sampler settings or evaluate image quality.

Inputs

  • Latent feature matrix used as query input.
  • Conditioning token matrix used as key/value input.
  • Projection matrices for query, key, and value.
  • Optional mask for unavailable conditioning tokens.

Outputs

  • Conditioned feature matrix.
  • Attention probabilities with rows summing to one.
  • Shape validation errors for incompatible inputs.
  • Diagnostics showing conditioning sensitivity.

Workflow

  1. Validate that feature and token inputs are rectangular numeric matrices.
  2. Project latent features to queries and conditioning tokens to keys and values.
  3. Compute scaled dot-product attention with stable softmax.
  4. Return conditioned values and probability diagnostics.
  5. Keep sampling choices and final image decisions outside this module's contract.

Validation

Run python scripts/cross_attention.py --output /tmp/attention.json. The included tests check probability normalization, output shape, conditioning sensitivity, and shape errors.

Limitations

This is a deterministic reference implementation for mechanism validation. Production LDMs use tensor libraries, batched multi-head attention, residual blocks, and learned encoders.

저장한 Skills