Learn R Programming

ggmlR (version 0.8.4)

ggml_cross_entropy_loss: Cross-Entropy Loss (Graph)

Description

Creates a graph node computing the cross-entropy loss between logits a and labels b. The op applies its own softmax, so a must be logits, not probabilities.

Usage

ggml_cross_entropy_loss(ctx, a, b)

Value

A scalar tensor holding the loss

Arguments

ctx

GGML context

a

Logits

b

Labels, same shape as a

Details

Differentiable: the backward pass is wired into the graph, so this can be used as a training loss in a hand-built graph.

See Also

ggml_cross_entropy_loss_back