Tinkex.Future.Combiner (Tinkex v0.3.4)

View Source

Helpers for combining chunked forward/backward results returned by the API.

Training client callers rely on this module to flatten chunk responses and apply metric reduction identical to the Python SDK.

Summary

Functions

Combine multiple chunked %ForwardBackwardOutput{} structs into a single struct.

Functions

combine_forward_backward_results(results)

@spec combine_forward_backward_results([Tinkex.Types.ForwardBackwardOutput.t()]) ::
  Tinkex.Types.ForwardBackwardOutput.t()

Combine multiple chunked %ForwardBackwardOutput{} structs into a single struct.

  • loss_fn_output_type is taken from the first chunk. When later chunks disagree a warning is logged but the first value still wins.
  • loss_fn_outputs are flattened in chunk order.
  • metrics are merged via Tinkex.MetricsReduction.reduce/1.