Tinkex.API.Training (Tinkex v0.3.4)
View SourceTraining API endpoints.
Uses :training pool (sequential, long-running operations). Pool size: 5 connections.
Summary
Functions
Forward pass only (inference).
Forward-backward pass for gradient computation.
Forward-backward pass that returns a server-side future reference.
Forward pass that returns a server-side future reference.
Optimizer step to update model parameters.
Optimizer step that returns a server-side future reference.
Functions
@spec forward( map(), keyword() ) :: {:ok, Tinkex.Types.ForwardBackwardOutput.t() | map()} | {:error, Tinkex.Error.t()}
Forward pass only (inference).
This helper awaits the future internally. Use
forward_future/2 to get the raw future response.
@spec forward_backward( map(), keyword() ) :: {:ok, Tinkex.Types.ForwardBackwardOutput.t() | map()} | {:error, Tinkex.Error.t()}
Forward-backward pass for gradient computation.
This helper awaits the future internally. Use
forward_backward_future/2 to get the raw future response.
Examples
Tinkex.API.Training.forward_backward(
%{model_id: "...", inputs: [...]},
config: config
)
@spec forward_backward_future( map(), keyword() ) :: {:ok, map()} | {:error, Tinkex.Error.t()}
Forward-backward pass that returns a server-side future reference.
@spec forward_future( map(), keyword() ) :: {:ok, map()} | {:error, Tinkex.Error.t()}
Forward pass that returns a server-side future reference.
Returns a future that can be polled for the forward pass result containing
logprobs that can be converted to Nx tensors via TensorData.to_nx/1.
@spec optim_step( map(), keyword() ) :: {:ok, Tinkex.Types.OptimStepResponse.t() | map()} | {:error, Tinkex.Error.t()}
Optimizer step to update model parameters.
@spec optim_step_future( map(), keyword() ) :: {:ok, map()} | {:error, Tinkex.Error.t()}
Optimizer step that returns a server-side future reference.