Learn R Programming

ggmlR (version 0.8.4)

ggml_set_loss: Mark a Tensor as the Loss

Description

Marks a tensor as the quantity to differentiate. ggml_build_backward_expand requires the graph to contain one -- together with at least one ggml_set_param tensor, these are the two ends of the backward pass.

Usage

ggml_set_loss(tensor)

Value

The tensor (for chaining)

Arguments

tensor

Tensor pointer, usually a scalar produced by ggml_sum or a loss op

Details

A graph missing either is rejected with an error rather than aborting inside ggml.

See Also

ggml_set_param, ggml_build_forward_expand_grads