score opattnmap → attnmapimport fullseye as fs; fs.ledger.attention_weights(scores, mask=None, window=None) -> 'np.ndarray' (実装を直接呼ぶなら import llmcore; llmcore.attention_weights(scores, mask=None, window=None) -> 'np.ndarray'、台帳から引くなら opsllmcore.get("attention_weights"))行ごとの softmax(マスクつき)→ attnmap。行和は 1、mask 位置は厳密に 0。
行ごとに最大値を引いてから指数を取る。これは飾りではない —— 引かずに exp すると
スコアが大きいとき全行が inf/NaN になる(実測: 96 行中 96 行)。引けば 0 行。
Args:
scores: (T, T) float の生スコア(attention_scores の出力)。
mask: None(全対)/ "causal"(下三角)/ "window"(幅 window の因果窓)/
(T, T) の bool 配列。True が「見てよい」。
window: mask="window" のときの窓幅(自分を含む個数)。
Returns:
attnmap (T, T) float: 各行が確率分布(和 1)。mask が False の位置は厳密に 0。
py -3.11 examples/poc_attention_identities.pyattnmap を入力に取れる)score)attention_scores · attention_apply
Provenance: llmcore.py — LLMCORE operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.