Expand description
Answers, built from a question’s option logits and act logits the way Laya builds them.
This is Laya’s Agent._decode_answers (unchanged from 0.3.7 to 0.3.11), done in the same float
types numpy uses so the rounded numbers match: the calibrated softmax and the entropy in f32,
the expected score in f64, and sums in numpy’s pairwise order. exp and log are numpy’s own
AVX2 routines rather than libm’s, since they differ in the last bit often enough to move a
rounded probability: 2 of the 400 parity responses changed in the fourth decimal with libm.
Structs§
- Response
- The answers to one request.
- Temperatures
- The calibration of a compat checkpoint, from its
rl_agent_config.json, already clamped.
Enums§
- Answer
- One question’s answer.
Constants§
- LAYA_
MODEL - The
modelfield of a compat response. - TEMPERATURE_
RANGE - The range Laya 0.3.9 and later confine a checkpoint’s temperatures to. The English checkpoint
ships 0.1006 for
choice:11+, which would sharpen the logits tenfold.
Functions§
- act_
probability - The act head’s first probability, as
torch.softmaxgives it. - clamp_
temperature - A temperature Laya would use:
tconfined toTEMPERATURE_RANGE, or 1 when it is not a finite number. - laya_
answer - The answer to
qfrom its option logits, in option order, and its two act logits. - py_
round - Rounds to
digitsplaces the way Python’srounddoes: correctly, ties to even. - temperature_
bucket - Laya’s
temp_bucket: the key oftemperature_by_optionsfor a type and an option count.