Rust · Choices

Choices

use uform::TextChoose;use uform::TextChooseConfig;use uform::Choices; 4.0.0-rc.1 · 3ee5e534

API

StructTextChooseA text forward scoring each item's legal choices; see EncodeVerbs::text_choose.
encode.rs:793 ↗
pub struct TextChoose<'config, 'arena, Texts, Choices>

Calls uform_text_choose.

StructTextChooseConfigThe question types and the knobs of EncodeVerbs::text_choose; TextChooseConfig::default puts every item in group zero.
encode.rs:520 ↗
pub struct TextChooseConfig<'config>

Mirrors uform_text_choose_t.

Fields

temperature_groups&'config [u32]The question type of each item, below the model's choice_temperature_groups; empty puts every item in group zero.
progressOption<&'config mut ProgressCallback<'config>>Reports the items scored and stops wherever it says to; a stopped call reports Status::Cancelled and leaves no outputs.
progress_stepsusizeReports the call makes at most, the last at completion; zero derives to ten.
statsOption<&'config mut TextEncodeStats>Where the truncation report lands, overwritten by the call.

Implements

Default
StructChoicesSearchJev's calibrated choices over the byte decoder: the masked head's byte logits read at a mask byte appended to a state, restricted to the item's legal bytes.
train.rs:591 ↗
pub struct Choices

Each choice item scores −Σ t·log(p) + brier_weight·Σ (p − t)², with p that restricted softmax and t its targets.

Mirrors uform_choices_t.

Fields

weightf32The loss weight; zero trains no choices.
brier_weightf32The Brier term's weight beside the soft cross-entropy; 0.5.

Implements

Clone, Copy, StructuralPartialEq, PartialEq, Debug, Default