76 std::vector<int64_t> last_target_indices_;
78 bool has_forwarded_ =
false;
BS = mean_n( Σ_k (p[n,k] − y[n,k])² ), y one-hot at target_class[n] – Brier's original multi-class pr...
Definition calibration_loss.hpp:39
Tensor backward() const
Gradient w.r.t. probs: 2(p[n,k] − y[n,k]) / N.
CalibrationLoss(DeviceBackend *backend)
Constructs a calibration loss.
float forward(const Tensor &probs, const Tensor &target_class)
Computes the Brier score and caches what backward() needs.
Vendor-agnostic compute/memory backend. CPUBackend, CUDABackend (Phase 1.5), and HIPBackend (Phase 1....
Definition device_backend.hpp:219
An N-dimensional shape. A plain aggregate of dimensions with no invariant beyond "non-negative dimens...
Definition shape.hpp:24
N-dimensional tensor. Owns its data buffer exclusively; a DeviceBackend* is injected (not owned) – th...
Definition tensor.hpp:29
Abstract interface isolating vendor-specific memory/compute operations from Tensor/ComputationGraph.
Definition acquisition_functions.hpp:16
N-dimensional tensor – owns a buffer via DeviceBackend*, RAII (Rule of Five).