R L
Custom forward-backward pass
Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities.
Authorization
bearerAuth AuthorizationBearer <token>
In: header
Path Parameters
session_id*string
Training session ID
Header Parameters
Idempotency-Key*string
Required key that makes retries return the original operation; use a new key for changed request bodies.
Request Body
application/json
Request body for a custom forward-backward pass.
samples*array<>
Batch of training samples
gradients*array<>
Per-sample per-token gradients of the loss with respect to log-probabilities
Response Body
application/json
application/json
curl -X POST "https://example.com/rl/training-sessions/string/operations/custom-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" } } } ], "gradients": [ { "data": [ 0 ] } ] }'{ "id": "string", "status": "TRAINING_OPERATION_STATUS_UNSPECIFIED", "output": {}, "error": { "code": "TRAINING_OPERATION_ERROR_CODE_UNSPECIFIED", "message": "string" }}