Skip to content

Commit

Permalink
Deploying to gh-pages from @ 3bc96c1 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
TimotheeMickus committed Sep 25, 2023
1 parent 23586a7 commit 04b19cf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions _modules/onmt/trainer.html
Original file line number Diff line number Diff line change
Expand Up @@ -558,12 +558,12 @@ <h1>Source code for onmt.trainer</h1><div class="highlight"><pre>
<span class="n">valid_stats</span><span class="o">=</span><span class="n">valid_stats</span><span class="p">,</span>
<span class="p">)</span>

<span class="c1"># # Run patience mechanism</span>
<span class="c1"># if self.earlystopper is not None:</span>
<span class="c1"># self.earlystopper(valid_stats, step)</span>
<span class="c1"># # If the patience has reached the limit, stop training</span>
<span class="c1"># if self.earlystopper.has_stopped():</span>
<span class="c1"># break</span>
<span class="c1"># Run patience mechanism</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">earlystopper</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">earlystopper</span><span class="p">(</span><span class="n">valid_stats</span><span class="p">,</span> <span class="n">step</span><span class="p">)</span>
<span class="c1"># If the patience has reached the limit, stop training</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">earlystopper</span><span class="o">.</span><span class="n">has_stopped</span><span class="p">():</span>
<span class="k">break</span>

<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">model_saver</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="p">(</span><span class="n">save_checkpoint_steps</span> <span class="o">!=</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">step</span> <span class="o">%</span> <span class="n">save_checkpoint_steps</span> <span class="o">==</span> <span class="mi">0</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">model_saver</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">step</span><span class="p">,</span> <span class="n">moving_average</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">moving_average</span><span class="p">)</span>
Expand Down

0 comments on commit 04b19cf

Please sign in to comment.