mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
Deployed 1514810 with MkDocs version: 1.0.4
This commit is contained in:
@@ -344,6 +344,26 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#debugging" title="Debugging" class="md-nav__link">
|
||||
Debugging
|
||||
</a>
|
||||
|
||||
<nav class="md-nav">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#example_input_array" title="example_input_array" class="md-nav__link">
|
||||
example_input_array
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -595,6 +615,26 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#debugging" title="Debugging" class="md-nav__link">
|
||||
Debugging
|
||||
</a>
|
||||
|
||||
<nav class="md-nav">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#example_input_array" title="example_input_array" class="md-nav__link">
|
||||
example_input_array
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -647,6 +687,17 @@ self.experiment.add_scalars(...)
|
||||
self.trainer.current_epoch
|
||||
...
|
||||
</code></pre>
|
||||
|
||||
<h2 id="debugging">Debugging</h2>
|
||||
<p>The LightningModule also offers these tricks to help debug. </p>
|
||||
<hr />
|
||||
<h4 id="example_input_array">example_input_array</h4>
|
||||
<p>In the LightningModule init, you can set a dummy tensor for this property
|
||||
to get a print out of sizes coming into and out of every layer. </p>
|
||||
<pre><code class="python">def __init__(self):
|
||||
# put the dimensions of the first input to your system
|
||||
self.example_input_array = torch.rand(5, 28 * 28)
|
||||
</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -675,6 +675,14 @@ Trainer(experiment=exp)
|
||||
|
||||
<hr />
|
||||
<h3 id="tensorboard-support">Tensorboard support</h3>
|
||||
<p>In the LightningModule you can access the experiment logger by doing:</p>
|
||||
<pre><code class="python">self.experiment
|
||||
|
||||
# add image
|
||||
# Look at PyTorch SummaryWriter docs for what you can do.
|
||||
self.experiment.add_image(...)
|
||||
</code></pre>
|
||||
|
||||
<p>The experiment object is a strict subclass of PyTorch SummaryWriter. However, this class
|
||||
also snapshots every detail about the experiment (data folder paths, code, hyperparams),
|
||||
and allows you to visualize it using tensorboard.</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Reference in New Issue
Block a user