forked from fastai/fastai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.mod_display.html
166 lines (124 loc) · 5.22 KB
/
utils.mod_display.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
title: utils.mod_display
keywords:
sidebar: home_sidebar
---
<!--
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: docs_src/utils.mod_display.ipynb
# instructions: https://docs.fast.ai/gen_doc_main.html
-->
<div class="container" id="notebook-container">
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Modify-Display-Utils">Modify Display Utils<a class="anchor-link" href="#Modify-Display-Utils">¶</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Utilities for collecting/checking <a href="/fastai.html#fastai"><code>fastai</code></a> user environment</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="kn">from</span> <span class="nn">fastai.utils.mod_display</span> <span class="k">import</span> <span class="o">*</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h2 id="progress_disabled_ctx" class="doc_header"><code>class</code> <code>progress_disabled_ctx</code><a href="https://github.com/fastai/fastai/blob/master/fastai/utils/mod_display.py#L10" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#progress_disabled_ctx-pytest" style="float:right; padding-right:10px">[test]</a></h2><blockquote><p><code>progress_disabled_ctx</code>(<strong><code>learn</code></strong>:<a href="/basic_train.html#Learner"><code>Learner</code></a>)</p>
</blockquote>
<div class="collapse" id="progress_disabled_ctx-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#progress_disabled_ctx-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>Tests found for <code>progress_disabled_ctx</code>:</p><ul><li><code>pytest -sv tests/test_mod_display.py::test_progress_disabled_ctx</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_mod_display.py#L16" class="source_link" style="float:right">[source]</a></li></ul><p>To run tests please refer to this <a href="/dev/test.html#quick-guide">guide</a>.</p></div></div><p>Context manager to disable the progress update bar and Recorder print.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><code>learn.fit()</code> will display a progress bar and give the final results once completed:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">learn</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_html rendered_html output_subarea ">
Total time: 00:04 <p><table border="1" class="dataframe">
<thead>
<tr style="text-align: left;">
<th>epoch</th>
<th>train_loss</th>
<th>valid_loss</th>
<th>accuracy</th>
<th>time</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>0.146324</td>
<td>0.082466</td>
<td>0.971541</td>
<td>00:04</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><a href="/utils.mod_display.html#progress_disabled_ctx"><code>progress_disabled_ctx</code></a> will remove all that update and only show the total time once completed.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="k">with</span> <span class="n">progress_disabled_ctx</span><span class="p">(</span><span class="n">learn</span><span class="p">)</span> <span class="k">as</span> <span class="n">learn</span><span class="p">:</span>
<span class="n">learn</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_subarea output_stream output_stdout output_text">
<pre>Total time: 00:03
</pre>
</div>
</div>
</div>
</div>
</div>
</div>