# Choices

> UForm for Swift

`textChoose` scores each text's legal choices, one byte each, through one forward of the byte decoder, a softmax over that item's choices alone at its question type's calibrated inverse temperature.
The call appends the mask byte, and a text longer than the context loses its head, never its end.
A model whose `choiceTemperatureGroups` is zero carries no byte decoder and refuses with `unsupported`.

```swift
let chosen = try model.textChoose(
    ["keep this candidate? ", "expand which neighbor? "],
    choices: [Array("yn".utf8), Array("ABCD".utf8)],
    temperatureGroups: [0, 1],
    arena: arena)
let keep = chosen.probabilities[0][0]           // one Float per choice, in the order offered
```

`import UForm`

## Chosen

What one choose call wrote into its arena, read in place until the arena's next call.

```swift
struct Chosen
```

## probabilities

One probability per choice, in the order each item offered them.

```swift
let probabilities: Tape
```

## stats

What the call counted on the way.

```swift
let stats: EncodeStats
```

## Choices

Calibrated choices over the byte decoder: each choice item scores the soft cross-entropy of its legal bytes' softmax, plus [`brierWeight`](#brierWeight) times its Brier score.

```swift
struct Choices
```

Mirrors `uform_choices_t`.

Conforms to: `Sendable`

## weight

The loss weight; zero trains no choices.

```swift
var weight: Float
```

## brierWeight

The Brier term's weight beside the soft cross-entropy; zero derives 0.5.

```swift
var brierWeight: Float
```

## init

Takes every field by name; a zero derives as its field documents.

```swift
init(weight: Float = 0, brierWeight: Float = 0)
```

