TorchJD: A PyTorch Library for Multi-Loss Training

Skeylos2 · reddit · 2026-07-08

Introduces the PyTorch library TorchJD, designed for multi-loss training. It contrasts scalarization (combining multiple losses into a single loss before performing gradient descent) with Jacobian descent (computing gradients for each loss individually and then aggregating them into an update vector that simultaneously reduces all losses). The latter is superior when multi-objective conflicts are severe. The library implements the two main methods found in the literature and has been officially incorporated into the PyTorch ecosystem.

Original post →

More from coding & agent

coding & agent channel →