LibMTL.weighting.PCGrad

class PCGrad[source]

Bases: LibMTL.weighting.abstract_weighting.AbsWeighting

Project Conflicting Gradients (PCGrad).

This method is proposed in Gradient Surgery for Multi-Task Learning (NeurIPS 2020) and implemented by us.

Warning

PCGrad is not supported by representation gradients, i.e., rep_grad must be False.

backward(self, losses, **kwargs)[source]
Parameters
  • losses (list) – A list of losses of each task.

  • kwargs (dict) – A dictionary of hyperparameters of weighting methods.