ConFIG

class torchjd.aggregation.config.ConFIG(pref_vector=None)

Aggregator as defined in Equation 2 of ConFIG: Towards Conflict-free Training of Physics Informed Neural Networks.

Parameters:

pref_vector (Tensor | None) – The preference vector used to weight the rows. If not provided, defaults to equal weights of 1.

Example

Use ConFIG to aggregate a matrix.

>>> from torch import tensor
>>> from torchjd.aggregation import ConFIG
>>>
>>> A = ConFIG()
>>> J = tensor([[-4., 1., 1.], [6., 1., 1.]])
>>>
>>> A(J)
tensor([0.1588, 2.0706, 2.0706])

Note

This implementation was adapted from the official implementation.