You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">torchjd.autogram.</span></span><spanclass="sig-name descname"><spanclass="pre">Engine</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">modules</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">batch_dim</span></span></em><spanclass="sig-paren">)</span><aclass="reference external" href="https://github.com/TorchJD/torchjd/blob/main/src/torchjd/autogram/_engine.py#L46-L301"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#torchjd.autogram.Engine" title="Link to this definition">¶</a></dt>
254
+
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">torchjd.autogram.</span></span><spanclass="sig-name descname"><spanclass="pre">Engine</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">modules</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">batch_dim</span></span></em><spanclass="sig-paren">)</span><aclass="reference external" href="https://github.com/TorchJD/torchjd/blob/main/src/torchjd/autogram/_engine.py#L46-L315"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#torchjd.autogram.Engine" title="Link to this definition">¶</a></dt>
255
255
<dd><p>Engine to compute the Gramian of the Jacobian of some tensor with respect to the direct
256
256
parameters of all provided modules. It is based on Algorithm 3 of <aclass="reference external" href="https://arxiv.org/pdf/2406.16232">Jacobian Descent For
257
257
Multi-Objective Optimization</a> but goes even further:</p>
@@ -347,6 +347,22 @@ <h1>Engine<a class="headerlink" href="#engine" title="Link to this heading">¶</
347
347
<p>The alternative is to use <codeclass="docutils literal notranslate"><spanclass="pre">batch_dim=None</span></code>, but it’s not recommended since it will
348
348
increase memory usage by a lot and thus typically slow down computation.</p>
349
349
</div>
350
+
<divclass="admonition warning">
351
+
<pclass="admonition-title">Warning</p>
352
+
<p>Parent modules should call their child modules directly rather than using their child
353
+
modules’ parameters themselves. For instance, the following model is not supported:</p>
<spanclass="sig-name descname"><spanclass="pre">compute_gramian</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">output</span></span></em><spanclass="sig-paren">)</span><aclass="reference external" href="https://github.com/TorchJD/torchjd/blob/main/src/torchjd/autogram/_engine.py#L201-L270"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#torchjd.autogram.Engine.compute_gramian" title="Link to this definition">¶</a></dt>
375
+
<spanclass="sig-name descname"><spanclass="pre">compute_gramian</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">output</span></span></em><spanclass="sig-paren">)</span><aclass="reference external" href="https://github.com/TorchJD/torchjd/blob/main/src/torchjd/autogram/_engine.py#L215-L284"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#torchjd.autogram.Engine.compute_gramian" title="Link to this definition">¶</a></dt>
360
376
<dd><p>Computes the Gramian of the Jacobian of <codeclass="docutils literal notranslate"><spanclass="pre">output</span></code> with respect to the direct parameters of
361
377
all <codeclass="docutils literal notranslate"><spanclass="pre">modules</span></code>.</p>
0 commit comments