DualProj¶
- class torchjd.aggregation.DualProj(pref_vector=None, projector=None)[source]¶
GramianWeightedAggregatorthat averages the rows of the input matrix, and projects the result onto the dual cone of the rows of the matrix. This corresponds to the solution to Equation 11 of Gradient Episodic Memory for Continual Learning.- Parameters:
pref_vector (
Tensor|None) – The preference vector used to combine the rows. If not provided, defaults to \(\begin{bmatrix} \frac{1}{m} & \dots & \frac{1}{m} \end{bmatrix}^T \in \mathbb{R}^m\).projector (
DualConeProjector|None) – TheDualConeProjectorused to compute the projection.
- class torchjd.aggregation.DualProjWeighting(pref_vector=None, projector=None)[source]¶
Weighting[PSDMatrix] giving the weights ofDualProj.- Parameters:
pref_vector (
Tensor|None) – The preference vector to use. If not provided, defaults to \(\begin{bmatrix} \frac{1}{m} & \dots & \frac{1}{m} \end{bmatrix}^T \in \mathbb{R}^m\).projector (
DualConeProjector|None) – TheDualConeProjectorused to compute the projection.