Deployed a7a14da with MkDocs version: 1.0.4

This commit is contained in:
William Falcon
2019-08-18 17:25:20 -05:00
parent 971d59efe8
commit 56cd3dd176
9 changed files with 34 additions and 28 deletions
@@ -1064,13 +1064,13 @@
<span class="c1"># REQUIRED</span>
<span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">batch</span>
<span class="n">y_hat</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">forward</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="k">return</span> <span class="p">{</span><span class="s1">&#39;loss&#39;</span><span class="p">:</span> <span class="n">F</span><span class="o">.</span><span class="n">cross_entropy</span><span class="p">(</span><span class="n">y_hat</span><span class="p">,</span> <span class="n">y</span><span class="p">)(</span><span class="n">y_hat</span><span class="p">,</span> <span class="n">y</span><span class="p">)}</span>
<span class="k">return</span> <span class="p">{</span><span class="s1">&#39;loss&#39;</span><span class="p">:</span> <span class="n">F</span><span class="o">.</span><span class="n">cross_entropy</span><span class="p">(</span><span class="n">y_hat</span><span class="p">,</span> <span class="n">y</span><span class="p">)}</span>
<span class="k">def</span> <span class="nf">validation_step</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">batch</span><span class="p">,</span> <span class="n">batch_nb</span><span class="p">):</span>
<span class="c1"># OPTIONAL</span>
<span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">batch</span>
<span class="n">y_hat</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">forward</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="k">return</span> <span class="p">{</span><span class="s1">&#39;val_loss&#39;</span><span class="p">:</span> <span class="n">F</span><span class="o">.</span><span class="n">cross_entropy</span><span class="p">(</span><span class="n">y_hat</span><span class="p">,</span> <span class="n">y</span><span class="p">)(</span><span class="n">y_hat</span><span class="p">,</span> <span class="n">y</span><span class="p">)}</span>
<span class="k">return</span> <span class="p">{</span><span class="s1">&#39;val_loss&#39;</span><span class="p">:</span> <span class="n">F</span><span class="o">.</span><span class="n">cross_entropy</span><span class="p">(</span><span class="n">y_hat</span><span class="p">,</span> <span class="n">y</span><span class="p">)}</span>
<span class="k">def</span> <span class="nf">validation_end</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">outputs</span><span class="p">):</span>
<span class="c1"># OPTIONAL</span>
@@ -1532,7 +1532,7 @@ If you saved something with <strong>on_save_checkpoint</strong> this is your cha
<h3 id="val_dataloader">val_dataloader</h3>
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2</pre></div></td><td class="code"><div class="codehilite"><pre><span></span><span class="nd">@pl.data_loader</span>
<span class="k">def</span> <span class="nf">tng_dataloader</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">val_dataloader</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
</pre></div>
</td></tr></table>
@@ -1623,7 +1623,7 @@ If you don't need a test dataset and a test_step, you don't need to implement th
</td></tr></table>
<p>Called by lightning right before it logs metrics for this batch.
This is a chance to ammend or add to the metrics about to be logged.</p>
This is a chance to amend or add to the metrics about to be logged.</p>
<h5 id="return_6">Return</h5>
<p>Dict </p>
<p><strong>Example</strong></p>
+1 -1
View File
@@ -665,7 +665,7 @@
<p>Current dtype </p>
<hr />
<h4 id="experiment">experiment</h4>
<p>An instance of test-tube Experiment which you can use to log anything for tensorboarX. </p>
<p>An instance of test-tube Experiment which you can use to log anything for tensorboard (subclass of <a href="https://pytorch.org/docs/stable/tensorboard.html">PyTorch SummaryWriter</a>). </p>
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3</pre></div></td><td class="code"><div class="codehilite"><pre><span></span><span class="bp">self</span><span class="o">.</span><span class="n">experiment</span><span class="o">.</span><span class="n">add_embedding</span><span class="p">(</span><span class="o">...</span><span class="p">)</span>
+9 -7
View File
@@ -546,7 +546,7 @@
<h1>Checkpointing</h1>
<p>i Lightning can automate saving and loading checkpoints.</p>
<p>Lightning can automate saving and loading checkpoints.</p>
<hr />
<h3 id="model-saving">Model saving</h3>
<p>To enable checkpointing, define the checkpoint callback and give it to the trainer.</p>
@@ -600,12 +600,14 @@ However, the dataloaders will start from the first batch again (if you shuffled
</pre></div>
</td></tr></table>
<p>The trainer restores:<br />
- global_step <br />
- current_epoch <br />
- All optimizers <br />
- All lr_schedulers <br />
- Model weights</p>
<p>The trainer restores: </p>
<ul>
<li>global_step </li>
<li>current_epoch </li>
<li>All optimizers </li>
<li>All lr_schedulers </li>
<li>Model weights</li>
</ul>
<p>You can even change the logic of your model as long as the weights and "architecture" of
the system isn't different. If you add a layer, for instance, it might not work. </p>
<p>At a rough level, here's <a href="https://github.com/williamFalcon/pytorch-lightning/blob/master/pytorch_lightning/root_module/model_saving.py#L63">what happens inside Trainer</a>: </p>
+2 -1
View File
@@ -664,7 +664,8 @@ Specifically, this will <a href="https://pytorch.org/docs/stable/nn.html#torch.n
<hr />
<h4 id="set-how-much-of-the-training-set-to-check">Set how much of the training set to check</h4>
<p>If you don't want to check 100% of the training set (for debugging or if it's huge), set this flag</p>
<p>If you don't want to check 100% of the training set (for debugging or if it's huge), set this flag.</p>
<p>train_percent_check will be overwritten by overfit_pct if <code>overfit_pct &gt; 0</code></p>
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
+2
View File
@@ -604,6 +604,7 @@ Lightning will run 5 steps of validation in the beginning of training as a sanit
<hr />
<h4 id="set-how-much-of-the-validation-set-to-check">Set how much of the validation set to check</h4>
<p>If you don't want to check 100% of the validation set (for debugging or if it's huge), set this flag</p>
<p>val_percent_check will be overwritten by overfit_pct if <code>overfit_pct &gt; 0</code></p>
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
@@ -619,6 +620,7 @@ Lightning will run 5 steps of validation in the beginning of training as a sanit
<hr />
<h4 id="set-how-much-of-the-test-set-to-check">Set how much of the test set to check</h4>
<p>If you don't want to check 100% of the test set (for debugging or if it's huge), set this flag</p>
<p>test_percent_check will be overwritten by overfit_pct if <code>overfit_pct &gt; 0</code></p>
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
+1
View File
@@ -631,6 +631,7 @@ Use this to debug a full run of your program quickly</p>
<hr />
<h4 id="make-model-overfit-on-subset-of-data">Make model overfit on subset of data</h4>
<p>A useful debugging trick is to make your model overfit a tiny fraction of the data.</p>
<p>setting <code>overfit_pct &gt; 0</code> will overwrite train_percent_check, val_percent_check, test_percent_check</p>
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
File diff suppressed because one or more lines are too long
+14 -14
View File
@@ -2,72 +2,72 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-08-16</lastmod>
<lastmod>2019-08-18</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
BIN
View File
Binary file not shown.