models/wolfDefender/src/wolf_defender_engine
library
Functions
-
wolfDefenderPool(List<Float32List> logits)
→ double
-
The injection probability of the windows'
logits: per class, a smooth
maximum over the windows (temperature 1 for one window, 0.1 for more),
normalized by the window count; then softmax. One window is the softmax of
its logits. Patronus's inference.py defines it.
-
wolfDefenderWindows(int tokens)
→ List<(int, int)>
-
The token ranges of the windows of
tokens tokens. Each has at most 2046
tokens; each after the first starts 64 tokens before the end of the one
before it. No tokens is one empty window.