tinker.types.Datum
Generated from tinker 0.30.4 at commit 1e5777e. Source links point at that snapshot.
class tinker.types.Datum()
Fields:
- model_input (ModelInput)
- loss_fn_inputs (LossFnInputs)
- model_input_spans (Optional[ProvenanceSpans]) – Provenance of the input tokens as assembled: consecutive runs tiling
model_input(lengths sum to its token length; position comes from order). Attach viawith_provenance. - loss_fn_input_spans (Optional[ProvenanceSpans]) – Attribution of the loss rows: consecutive runs tiling
loss_fn_inputs["target_tokens"](lengths sum to its length). Attach viawith_provenance.
with_provenance(model_input, loss_fn_inputs)
Return a copy carrying provenance for both span-annotated fields.
Each keyword names the Datum field whose positions its runs tile —
model_input spans tile the input tokens, loss_fn_inputs
spans tile loss_fn_inputs["target_tokens"]. Tiling is validated
here, so a miscounted partition fails at the call site rather than
as a request error.
Parameters:
Returns: Self
Referenced by
- tinker_cookbook.rl.assemble_training_data
- tinker_cookbook.rl.trajectory_to_data
- tinker_cookbook.supervised.StreamingSupervisedDatasetFromHFDataset.get_batch
- tinker_cookbook.supervised.SupervisedDataset.get_batch
- tinker_cookbook.supervised.SupervisedDatasetFromHFDataset.get_batch
- TrainingClient.forward
- TrainingClient.forward_backward
- TrainingClient.forward_backward_custom