UPGrad

class torchjd.aggregation.upgrad.UPGrad(pref_vector=None, norm_eps=0.0001, reg_eps=0.0001, solver='quadprog')

Aggregator that projects each row of the input matrix onto the dual cone of all rows of this matrix, and that combines the result, as proposed in Jacobian Descent For Multi-Objective Optimization.

Parameters:
  • pref_vector (Tensor | None) – The preference vector used to combine the projected rows. If not provided, defaults to the simple averaging of the projected rows.

  • norm_eps (float) – A small value to avoid division by zero when normalizing.

  • reg_eps (float) – A small value to add to the diagonal of the gramian of the matrix. Due to numerical errors when computing the gramian, it might not exactly be positive definite. This issue can make the optimization fail. Adding reg_eps to the diagonal of the gramian ensures that it is positive definite.

  • solver (Literal['quadprog']) – The solver used to optimize the underlying optimization problem.

Example

Use UPGrad to aggregate a matrix.

>>> from torch import tensor
>>> from torchjd.aggregation import UPGrad
>>>
>>> A = UPGrad()
>>> J = tensor([[-4., 1., 1.], [6., 1., 1.]])
>>>
>>> A(J)
tensor([0.2929, 1.9004, 1.9004])