Forward-backward pass
Submits a forward-backward pass operation that will asynchronously compute gradients via backpropagation.
Authorization
bearerAuth In: header
Path Parameters
Training session ID
Header Parameters
Required key that makes retries return the original operation; use a new key for changed request bodies.
Request Body
application/json
Batch of training samples to process
Loss function configuration
Return the loss function's per-sample output tensors alongside the loss and metrics. Defaults to false. Enabling it increases the response size substantially for large batches and reduces step throughput, so leave it unset for ordinary training steps.
Run the forward pass only: report the loss and metrics, and the per-sample outputs when requested, without accumulating gradients. Defaults to false. Pair it with return_loss_fn_outputs to score a batch and read back its per-token log-probabilities.
Response Body
application/json
application/json
curl -X POST "https://example.com/rl/training-sessions/string/operations/forward-backward" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "samples": [ { "model_input": { "chunks": [ { "encoded_text": { "tokens": [ "string" ] } } ] }, "loss_fn_inputs": { "property1": { "data": [ 0.1 ], "dtype": "int64" }, "property2": { "data": [ 0.1 ], "dtype": "int64" } } } ], "loss": { "type": "LOSS_TYPE_UNSPECIFIED" } }'{ "id": "string", "status": "TRAINING_OPERATION_STATUS_UNSPECIFIED", "output": { "loss": 0, "metrics": { "property1": 0, "property2": 0 }, "loss_fn_outputs": [ { "tensors": { "property1": { "data": [ 0.1 ], "dtype": "int64", "shape": [ 0 ], "sparse_crow_indices": [ 0 ], "sparse_col_indices": [ 0 ] }, "property2": { "data": [ 0.1 ], "dtype": "int64", "shape": [ 0 ], "sparse_crow_indices": [ 0 ], "sparse_col_indices": [ 0 ] } } } ] }, "error": { "code": "TRAINING_OPERATION_ERROR_CODE_UNSPECIFIED", "message": "string" }}