Tinkex.ByteEstimator (Tinkex v0.3.4)
View SourceByte size estimation for model inputs and datums.
Provides consistent heuristics across training chunking and sampling dispatch:
- Image chunks: raw byte size of the data string
- Image asset pointers: byte size of the location string
- Encoded text and other length-aware chunks: token count * 10 bytes
- Loss function inputs (TensorData / tensors / plain maps): element count * 10 bytes
Summary
Functions
Estimate byte size of a single ModelInput chunk.
Estimate byte size for a list of datums.
Estimate byte size of a Datum.
Estimate byte size of loss function inputs map.
Estimate byte size of a ModelInput.
Functions
@spec estimate_chunk_bytes(struct()) :: non_neg_integer()
Estimate byte size of a single ModelInput chunk.
@spec estimate_data_bytes([Tinkex.Types.Datum.t()]) :: non_neg_integer()
Estimate byte size for a list of datums.
@spec estimate_datum_bytes(Tinkex.Types.Datum.t() | map()) :: non_neg_integer()
Estimate byte size of a Datum.
@spec estimate_loss_fn_inputs_bytes(map() | any()) :: non_neg_integer()
Estimate byte size of loss function inputs map.
@spec estimate_model_input_bytes(Tinkex.Types.ModelInput.t() | any()) :: non_neg_integer()
Estimate byte size of a ModelInput.