Dsxir.Demo (dsxir v0.1.0)

Copy Markdown

A demo slotted into a predictor by an optimizer.

Wraps a %Dsxir.Example{} with a provenance tag. The chat adapter and the json adapter render %Dsxir.Demo{} and %Dsxir.Example{} identically; the tag is preserved across save/load via Dsxir.Artifact.

kind values:

source is populated only for :bootstrapped demos and carries the round index plus the trainset example index that produced the captured trace.

Summary

Functions

Wrap ex as a bootstrapped demo captured from a successful trace round. source records the round and trainset example that produced it.

Wrap ex as a labeled demo (provenance: directly from the trainset).

Types

kind()

@type kind() :: :labeled | :bootstrapped

source()

@type source() :: nil | %{round: pos_integer(), example_index: non_neg_integer()}

t()

@type t() :: %Dsxir.Demo{example: Dsxir.Example.t(), kind: kind(), source: source()}

Functions

bootstrapped(ex, source)

@spec bootstrapped(Dsxir.Example.t(), source()) :: t()

Wrap ex as a bootstrapped demo captured from a successful trace round. source records the round and trainset example that produced it.

labeled(ex)

@spec labeled(Dsxir.Example.t()) :: t()

Wrap ex as a labeled demo (provenance: directly from the trainset).