Files
pytorch-lightning/Trainer/Logging/index.html
T

285 lines
9.4 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../../img/favicon.ico">
<title>Logging - Pytorch lightning Documentation</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../../css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../css/theme_extra.css" type="text/css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
<script>
// Current page data
var mkdocs_page_name = "Logging";
var mkdocs_page_input_path = "Trainer/Logging.md";
var mkdocs_page_url = null;
</script>
<script src="../../js/jquery-2.1.1.min.js" defer></script>
<script src="../../js/modernizr-2.8.3.min.js" defer></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-nav-search">
<a href="../.." class="icon icon-home"> Pytorch lightning Documentation</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1">
<a class="" href="../..">PYTORCH-LIGHTNING DOCUMENTATION</a>
</li>
<li class="toctree-l1">
<a class="" href="../../Examples/">Examples</a>
</li>
<li class="toctree-l1">
<span class="caption-text">LightningModule</span>
<ul class="subnav">
<li class="">
<a class="" href="../../LightningModule/RequiredTrainerInterface/">Lightning Module interface</a>
</li>
<li class="">
<a class="" href="../../LightningModule/methods/">Methods</a>
</li>
<li class="">
<a class="" href="../../LightningModule/properties/">Properties</a>
</li>
</ul>
</li>
<li class="toctree-l1">
<span class="caption-text">Trainer</span>
<ul class="subnav">
<li class="">
<a class="" href="../">Trainer</a>
</li>
<li class="">
<a class="" href="../Checkpointing/">Checkpointing</a>
</li>
<li class="">
<a class="" href="../Distributed training/">Distributed training</a>
</li>
<li class=" current">
<a class="current" href="./">Logging</a>
<ul class="subnav">
<li class="toctree-l3"><a href="#display-metrics-in-progress-bar">Display metrics in progress bar</a></li>
<li class="toctree-l3"><a href="#log-metric-row-every-k-batches">Log metric row every k batches</a></li>
<li class="toctree-l3"><a href="#process-position">Process position</a></li>
<li class="toctree-l3"><a href="#save-a-snapshot-of-all-hyperparameters">Save a snapshot of all hyperparameters</a></li>
<li class="toctree-l3"><a href="#snapshot-code-for-a-training-run">Snapshot code for a training run</a></li>
<li class="toctree-l3"><a href="#write-logs-file-to-csv-every-k-batches">Write logs file to csv every k batches</a></li>
</ul>
</li>
<li class="">
<a class="" href="../SLURM Managed Cluster/">SLURM Managed Cluster</a>
</li>
<li class="">
<a class="" href="../Training Loop/">Training Loop</a>
</li>
<li class="">
<a class="" href="../Validation loop/">Validation loop</a>
</li>
<li class="">
<a class="" href="../debugging/">Debugging</a>
</li>
<li class="">
<a class="" href="../hooks/">Hooks</a>
</li>
</ul>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../..">Pytorch lightning Documentation</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../..">Docs</a> &raquo;</li>
<li>Trainer &raquo;</li>
<li>Logging</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/williamFalcon/pytorch-lightning/edit/master/docs/Trainer/Logging.md"
class="icon icon-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<p>Lighting offers a few options for logging information about model, gpu usage, etc (via test-tube). It also offers printing options for training monitoring.</p>
<hr />
<h4 id="display-metrics-in-progress-bar">Display metrics in progress bar</h4>
<pre><code class="python"># DEFAULT
trainer = Trainer(progress_bar=True)
</code></pre>
<hr />
<h4 id="log-metric-row-every-k-batches">Log metric row every k batches</h4>
<p>Every k batches lightning will make an entry in the metrics log</p>
<pre><code class="python"># DEFAULT (ie: save a .csv log file every 10 batches)
trainer = Trainer(add_log_row_interval=10)
</code></pre>
<hr />
<h4 id="process-position">Process position</h4>
<p>When running multiple models on the same machine we want to decide which progress bar to use.
Lightning will stack progress bars according to this value. </p>
<pre><code class="python"># DEFAULT
trainer = Trainer(process_position=0)
# if this is the second model on the node, show the second progress bar below
trainer = Trainer(process_position=1)
</code></pre>
<hr />
<h4 id="save-a-snapshot-of-all-hyperparameters">Save a snapshot of all hyperparameters</h4>
<p>Whenever you call .save() on the test-tube experiment it logs all the hyperparameters in current use.
Give lightning a test-tube Experiment object to automate this for you.</p>
<pre><code class="python">from test-tube import Experiment
exp = Experiment(...)
Trainer(experiment=exp)
</code></pre>
<hr />
<h4 id="snapshot-code-for-a-training-run">Snapshot code for a training run</h4>
<p>Whenever you call .save() on the test-tube experiment it snapshows all code and pushes to a git tag.
Give lightning a test-tube Experiment object to automate this for you.</p>
<pre><code class="python">from test-tube import Experiment
exp = Experiment(create_git_tag=True)
Trainer(experiment=exp)
</code></pre>
<hr />
<h4 id="write-logs-file-to-csv-every-k-batches">Write logs file to csv every k batches</h4>
<p>Every k batches, lightning will write the new logs to disk</p>
<pre><code class="python"># DEFAULT (ie: save a .csv log file every 100 batches)
trainer = Trainer(log_save_interval=100)
</code></pre>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../SLURM Managed Cluster/" class="btn btn-neutral float-right" title="SLURM Managed Cluster">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../Distributed training/" class="btn btn-neutral" title="Distributed training"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
</div>
Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" style="cursor: pointer">
<span class="rst-current-version" data-toggle="rst-current-version">
<a href="https://github.com/williamFalcon/pytorch-lightning/" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
<span><a href="../Distributed training/" style="color: #fcfcfc;">&laquo; Previous</a></span>
<span style="margin-left: 15px"><a href="../SLURM Managed Cluster/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script>var base_url = '../..';</script>
<script src="../../js/theme.js" defer></script>
<script src="../../search/main.js" defer></script>
</body>
</html>