Skip to main content

HeadLoss

Trait HeadLoss 

Source
pub trait HeadLoss<V> {
    // Required method
    fn output_deltas<const N: usize>(
        logits: &[V; N],
        targets: &[V; N],
    ) -> [V; N];
}
Expand description

How a DenseHead turns its logits and a target into output deltas, following the library’s convention delta = -dL/dz: a parameter moves by +learning rate x delta x input.

Required Methods§

Source

fn output_deltas<const N: usize>(logits: &[V; N], targets: &[V; N]) -> [V; N]

deltas[k] for logits[k] and targets[k].

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§