@@ -117,16 +117,18 @@ changelog does not include internal changes that do not affect the user.
117117 ``` python
118118 # Before
119119 from torchjd.aggregation import Flattening, UPGradWeighting
120+
120121 weighting = Flattening(UPGradWeighting())
121122 gramian = engine.compute_gramian(losses) # shape: [m1, m2, m2, m1]
122- weights = weighting(gramian) # shape: [m1, m2]
123+ weights = weighting(gramian) # shape: [m1, m2]
123124 losses.backward(weights)
124125
125126 # After
126127 from torchjd.aggregation import UPGradWeighting
128+
127129 weighting = UPGradWeighting()
128- gramian = engine.compute_gramian(losses) # shape: [m1 * m2, m1 * m2]
129- weights = weighting(gramian).reshape(losses.shape) # shape: [m1, m2]
130+ gramian = engine.compute_gramian(losses) # shape: [m1 * m2, m1 * m2]
131+ weights = weighting(gramian).reshape(losses.shape) # shape: [m1, m2]
130132 losses.backward(weights)
131133 ```
132134
@@ -140,11 +142,13 @@ changelog does not include internal changes that do not affect the user.
140142 ``` python
141143 # Before
142144 from torchjd.aggregation import UPGrad
145+
143146 aggregator = UPGrad(norm_eps = 1e-6 , reg_eps = 1e-6 , solver = " quadprog" )
144147
145148 # After
146149 from torchjd.aggregation import UPGrad
147150 from torchjd.linalg import QuadprogProjector
151+
148152 aggregator = UPGrad(projector = QuadprogProjector(norm_eps = 1e-6 , reg_eps = 1e-6 ))
149153 ```
150154 If you used the default ` norm_eps ` , ` reg_eps ` and ` solver ` , you don't have to change anything and
0 commit comments