Skip to content

Commit 0c2da3c

Browse files
committed
Automated tutorials push
1 parent fed6e56 commit 0c2da3c

File tree

196 files changed

+13556
-12892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+13556
-12892
lines changed

_downloads/13cdb386a4b0dc48c626f32e6cf8681d/amp_recipe.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@
261261
"# The same ``GradScaler`` instance should be used for the entire convergence run.\n",
262262
"# If you perform multiple convergence runs in the same script, each run should use\n",
263263
"# a dedicated fresh ``GradScaler`` instance. ``GradScaler`` instances are lightweight.\n",
264-
"scaler = torch.cuda.amp.GradScaler()\n",
264+
"scaler = torch.amp.GradScaler(\"cuda\")\n",
265265
"\n",
266266
"for epoch in range(0): # 0 epochs, this section is for illustration only\n",
267267
" for input, target in zip(data, targets):\n",
@@ -308,7 +308,7 @@
308308
"\n",
309309
"net = make_model(in_size, out_size, num_layers)\n",
310310
"opt = torch.optim.SGD(net.parameters(), lr=0.001)\n",
311-
"scaler = torch.cuda.amp.GradScaler(enabled=use_amp)\n",
311+
"scaler = torch.amp.GradScaler(\"cuda\" ,enabled=use_amp)\n",
312312
"\n",
313313
"start_timer()\n",
314314
"for epoch in range(epochs):\n",

_downloads/cadb3a57e7a6d7c149b5ae377caf36a8/amp_recipe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def make_model(in_size, out_size, num_layers):
150150
# The same ``GradScaler`` instance should be used for the entire convergence run.
151151
# If you perform multiple convergence runs in the same script, each run should use
152152
# a dedicated fresh ``GradScaler`` instance. ``GradScaler`` instances are lightweight.
153-
scaler = torch.cuda.amp.GradScaler()
153+
scaler = torch.amp.GradScaler("cuda")
154154

155155
for epoch in range(0): # 0 epochs, this section is for illustration only
156156
for input, target in zip(data, targets):
@@ -182,7 +182,7 @@ def make_model(in_size, out_size, num_layers):
182182

183183
net = make_model(in_size, out_size, num_layers)
184184
opt = torch.optim.SGD(net.parameters(), lr=0.001)
185-
scaler = torch.cuda.amp.GradScaler(enabled=use_amp)
185+
scaler = torch.amp.GradScaler("cuda" ,enabled=use_amp)
186186

187187
start_timer()
188188
for epoch in range(epochs):
Loading
Loading

_images/sphx_glr_coding_ddpg_001.png

2.52 KB
Loading
-2.84 KB
Loading
74 Bytes
Loading
-6 Bytes
Loading
167 Bytes
Loading
694 Bytes
Loading
-159 Bytes
Loading
5.1 KB
Loading
Loading
339 Bytes
Loading
37 Bytes
Loading
Loading
-7.1 KB
Loading

_sources/advanced/coding_ddpg.rst.txt

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,26 +1634,26 @@ modules we need.
16341634
16351635
16361636
0%| | 0/10000 [00:00<?, ?it/s]
1637-
8%|8 | 800/10000 [00:00<00:05, 1660.50it/s]
1638-
16%|#6 | 1600/10000 [00:02<00:17, 477.55it/s]
1639-
24%|##4 | 2400/10000 [00:03<00:11, 674.49it/s]
1640-
32%|###2 | 3200/10000 [00:04<00:07, 850.24it/s]
1641-
40%|#### | 4000/10000 [00:04<00:06, 995.16it/s]
1642-
48%|####8 | 4800/10000 [00:05<00:04, 1116.81it/s]
1643-
56%|#####6 | 5600/10000 [00:05<00:03, 1208.77it/s]
1644-
reward: -2.34 (r0 = -2.00), reward eval: reward: -0.00, reward normalized=-2.59/6.17, grad norm= 147.92, loss_value= 295.62, loss_actor= 13.96, target value: -15.91: 56%|#####6 | 5600/10000 [00:06<00:03, 1208.77it/s]
1645-
reward: -2.34 (r0 = -2.00), reward eval: reward: -0.00, reward normalized=-2.59/6.17, grad norm= 147.92, loss_value= 295.62, loss_actor= 13.96, target value: -15.91: 64%|######4 | 6400/10000 [00:07<00:04, 841.61it/s]
1646-
reward: -0.11 (r0 = -2.00), reward eval: reward: -0.00, reward normalized=-1.53/5.46, grad norm= 118.19, loss_value= 194.76, loss_actor= 10.63, target value: -10.14: 64%|######4 | 6400/10000 [00:08<00:04, 841.61it/s]
1647-
reward: -0.11 (r0 = -2.00), reward eval: reward: -0.00, reward normalized=-1.53/5.46, grad norm= 118.19, loss_value= 194.76, loss_actor= 10.63, target value: -10.14: 72%|#######2 | 7200/10000 [00:08<00:03, 700.19it/s]
1648-
reward: -2.33 (r0 = -2.00), reward eval: reward: -0.00, reward normalized=-2.42/5.58, grad norm= 182.04, loss_value= 220.44, loss_actor= 13.69, target value: -16.09: 72%|#######2 | 7200/10000 [00:09<00:03, 700.19it/s]
1649-
reward: -2.33 (r0 = -2.00), reward eval: reward: -0.00, reward normalized=-2.42/5.58, grad norm= 182.04, loss_value= 220.44, loss_actor= 13.69, target value: -16.09: 80%|######## | 8000/10000 [00:10<00:03, 623.68it/s]
1650-
reward: -4.44 (r0 = -2.00), reward eval: reward: -0.00, reward normalized=-2.44/4.89, grad norm= 111.35, loss_value= 211.11, loss_actor= 15.74, target value: -15.42: 80%|######## | 8000/10000 [00:11<00:03, 623.68it/s]
1651-
reward: -4.44 (r0 = -2.00), reward eval: reward: -0.00, reward normalized=-2.44/4.89, grad norm= 111.35, loss_value= 211.11, loss_actor= 15.74, target value: -15.42: 88%|########8 | 8800/10000 [00:12<00:02, 588.63it/s]
1652-
reward: -4.96 (r0 = -2.00), reward eval: reward: -5.98, reward normalized=-2.32/4.85, grad norm= 54.44, loss_value= 165.27, loss_actor= 16.38, target value: -16.11: 88%|########8 | 8800/10000 [00:14<00:02, 588.63it/s]
1653-
reward: -4.96 (r0 = -2.00), reward eval: reward: -5.98, reward normalized=-2.32/4.85, grad norm= 54.44, loss_value= 165.27, loss_actor= 16.38, target value: -16.11: 96%|#########6| 9600/10000 [00:15<00:01, 399.47it/s]
1654-
reward: -4.86 (r0 = -2.00), reward eval: reward: -5.98, reward normalized=-3.02/4.89, grad norm= 173.10, loss_value= 234.27, loss_actor= 13.70, target value: -21.43: 96%|#########6| 9600/10000 [00:16<00:01, 399.47it/s]
1655-
reward: -4.86 (r0 = -2.00), reward eval: reward: -5.98, reward normalized=-3.02/4.89, grad norm= 173.10, loss_value= 234.27, loss_actor= 13.70, target value: -21.43: : 10400it [00:18, 364.88it/s]
1656-
reward: -4.93 (r0 = -2.00), reward eval: reward: -5.98, reward normalized=-3.38/3.91, grad norm= 120.25, loss_value= 129.44, loss_actor= 15.23, target value: -23.98: : 10400it [00:18, 364.88it/s]
1637+
8%|8 | 800/10000 [00:00<00:05, 1683.66it/s]
1638+
16%|#6 | 1600/10000 [00:02<00:17, 485.23it/s]
1639+
24%|##4 | 2400/10000 [00:03<00:11, 687.00it/s]
1640+
32%|###2 | 3200/10000 [00:04<00:07, 877.15it/s]
1641+
40%|#### | 4000/10000 [00:04<00:05, 1045.73it/s]
1642+
48%|####8 | 4800/10000 [00:05<00:04, 1188.29it/s]
1643+
56%|#####6 | 5600/10000 [00:05<00:03, 1288.59it/s]
1644+
reward: -2.38 (r0 = -3.75), reward eval: reward: -0.01, reward normalized=-2.90/6.27, grad norm= 184.34, loss_value= 346.66, loss_actor= 15.34, target value: -18.57: 56%|#####6 | 5600/10000 [00:06<00:03, 1288.59it/s]
1645+
reward: -2.38 (r0 = -3.75), reward eval: reward: -0.01, reward normalized=-2.90/6.27, grad norm= 184.34, loss_value= 346.66, loss_actor= 15.34, target value: -18.57: 64%|######4 | 6400/10000 [00:07<00:04, 876.74it/s]
1646+
reward: -0.14 (r0 = -3.75), reward eval: reward: -0.01, reward normalized=-2.44/5.85, grad norm= 49.14, loss_value= 239.65, loss_actor= 14.06, target value: -14.04: 64%|######4 | 6400/10000 [00:07<00:04, 876.74it/s]
1647+
reward: -0.14 (r0 = -3.75), reward eval: reward: -0.01, reward normalized=-2.44/5.85, grad norm= 49.14, loss_value= 239.65, loss_actor= 14.06, target value: -14.04: 72%|#######2 | 7200/10000 [00:08<00:03, 713.38it/s]
1648+
reward: -2.36 (r0 = -3.75), reward eval: reward: -0.01, reward normalized=-2.26/5.79, grad norm= 128.31, loss_value= 254.09, loss_actor= 12.59, target value: -14.58: 72%|#######2 | 7200/10000 [00:09<00:03, 713.38it/s]
1649+
reward: -2.36 (r0 = -3.75), reward eval: reward: -0.01, reward normalized=-2.26/5.79, grad norm= 128.31, loss_value= 254.09, loss_actor= 12.59, target value: -14.58: 80%|######## | 8000/10000 [00:10<00:03, 627.39it/s]
1650+
reward: -4.64 (r0 = -3.75), reward eval: reward: -0.01, reward normalized=-3.11/5.26, grad norm= 115.52, loss_value= 239.16, loss_actor= 18.21, target value: -19.89: 80%|######## | 8000/10000 [00:11<00:03, 627.39it/s]
1651+
reward: -4.64 (r0 = -3.75), reward eval: reward: -0.01, reward normalized=-3.11/5.26, grad norm= 115.52, loss_value= 239.16, loss_actor= 18.21, target value: -19.89: 88%|########8 | 8800/10000 [00:11<00:02, 582.30it/s]
1652+
reward: -4.99 (r0 = -3.75), reward eval: reward: -5.59, reward normalized=-3.11/5.35, grad norm= 68.47, loss_value= 219.28, loss_actor= 19.75, target value: -19.78: 88%|########8 | 8800/10000 [00:14<00:02, 582.30it/s]
1653+
reward: -4.99 (r0 = -3.75), reward eval: reward: -5.59, reward normalized=-3.11/5.35, grad norm= 68.47, loss_value= 219.28, loss_actor= 19.75, target value: -19.78: 96%|#########6| 9600/10000 [00:15<00:00, 404.39it/s]
1654+
reward: -5.39 (r0 = -3.75), reward eval: reward: -5.59, reward normalized=-3.21/5.31, grad norm= 204.79, loss_value= 298.20, loss_actor= 19.41, target value: -22.63: 96%|#########6| 9600/10000 [00:15<00:00, 404.39it/s]
1655+
reward: -5.39 (r0 = -3.75), reward eval: reward: -5.59, reward normalized=-3.21/5.31, grad norm= 204.79, loss_value= 298.20, loss_actor= 19.41, target value: -22.63: : 10400it [00:17, 366.15it/s]
1656+
reward: -4.68 (r0 = -3.75), reward eval: reward: -5.59, reward normalized=-3.57/4.27, grad norm= 74.57, loss_value= 203.88, loss_actor= 23.34, target value: -24.98: : 10400it [00:18, 366.15it/s]
16571657
16581658
16591659
@@ -1723,7 +1723,7 @@ To iterate further on this loss module we might consider:
17231723

17241724
.. rst-class:: sphx-glr-timing
17251725

1726-
**Total running time of the script:** ( 0 minutes 29.005 seconds)
1726+
**Total running time of the script:** ( 0 minutes 28.797 seconds)
17271727

17281728

17291729
.. _sphx_glr_download_advanced_coding_ddpg.py:

_sources/advanced/dynamic_quantization_tutorial.rst.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,9 @@ models run single threaded.
517517
.. code-block:: none
518518
519519
loss: 5.167
520-
elapsed time (seconds): 208.2
520+
elapsed time (seconds): 202.0
521521
loss: 5.168
522-
elapsed time (seconds): 115.8
522+
elapsed time (seconds): 113.8
523523
524524
525525
@@ -541,7 +541,7 @@ Thanks for reading! As always, we welcome any feedback, so please create an issu
541541

542542
.. rst-class:: sphx-glr-timing
543543

544-
**Total running time of the script:** ( 5 minutes 34.880 seconds)
544+
**Total running time of the script:** ( 5 minutes 26.458 seconds)
545545

546546

547547
.. _sphx_glr_download_advanced_dynamic_quantization_tutorial.py:

_sources/advanced/neural_style_tutorial.rst.txt

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -410,32 +410,33 @@ network to evaluation mode using ``.eval()``.
410410
Downloading: "https://download.pytorch.org/models/vgg19-dcbb9e9d.pth" to /var/lib/ci-user/.cache/torch/hub/checkpoints/vgg19-dcbb9e9d.pth
411411
412412
0%| | 0.00/548M [00:00<?, ?B/s]
413-
4%|3 | 20.5M/548M [00:00<00:02, 215MB/s]
414-
8%|7 | 41.5M/548M [00:00<00:02, 217MB/s]
415-
11%|#1 | 62.6M/548M [00:00<00:02, 219MB/s]
416-
15%|#5 | 83.9M/548M [00:00<00:02, 220MB/s]
417-
19%|#9 | 105M/548M [00:00<00:02, 221MB/s]
418-
23%|##3 | 126M/548M [00:00<00:02, 221MB/s]
419-
27%|##6 | 148M/548M [00:00<00:01, 221MB/s]
420-
31%|### | 169M/548M [00:00<00:01, 221MB/s]
421-
35%|###4 | 190M/548M [00:00<00:01, 221MB/s]
422-
39%|###8 | 211M/548M [00:01<00:01, 221MB/s]
423-
42%|####2 | 232M/548M [00:01<00:01, 221MB/s]
424-
46%|####6 | 254M/548M [00:01<00:01, 222MB/s]
425-
50%|##### | 275M/548M [00:01<00:01, 222MB/s]
426-
54%|#####4 | 296M/548M [00:01<00:01, 221MB/s]
427-
58%|#####7 | 317M/548M [00:01<00:01, 221MB/s]
428-
62%|######1 | 338M/548M [00:01<00:00, 221MB/s]
429-
66%|######5 | 360M/548M [00:01<00:00, 221MB/s]
430-
69%|######9 | 381M/548M [00:01<00:00, 221MB/s]
431-
73%|#######3 | 402M/548M [00:01<00:00, 221MB/s]
432-
77%|#######7 | 423M/548M [00:02<00:00, 221MB/s]
433-
81%|########1 | 444M/548M [00:02<00:00, 221MB/s]
434-
85%|########4 | 465M/548M [00:02<00:00, 221MB/s]
435-
89%|########8 | 486M/548M [00:02<00:00, 221MB/s]
436-
93%|#########2| 507M/548M [00:02<00:00, 221MB/s]
437-
96%|#########6| 528M/548M [00:02<00:00, 221MB/s]
438-
100%|##########| 548M/548M [00:02<00:00, 221MB/s]
413+
4%|3 | 20.4M/548M [00:00<00:02, 213MB/s]
414+
8%|7 | 41.1M/548M [00:00<00:02, 216MB/s]
415+
11%|#1 | 62.0M/548M [00:00<00:02, 217MB/s]
416+
15%|#5 | 82.9M/548M [00:00<00:02, 217MB/s]
417+
19%|#8 | 104M/548M [00:00<00:02, 218MB/s]
418+
23%|##2 | 125M/548M [00:00<00:02, 218MB/s]
419+
27%|##6 | 146M/548M [00:00<00:01, 218MB/s]
420+
30%|### | 166M/548M [00:00<00:01, 218MB/s]
421+
34%|###4 | 187M/548M [00:00<00:01, 218MB/s]
422+
38%|###8 | 208M/548M [00:01<00:01, 219MB/s]
423+
42%|####1 | 229M/548M [00:01<00:01, 219MB/s]
424+
46%|####5 | 250M/548M [00:01<00:01, 219MB/s]
425+
49%|####9 | 271M/548M [00:01<00:01, 219MB/s]
426+
53%|#####3 | 292M/548M [00:01<00:01, 219MB/s]
427+
57%|#####7 | 313M/548M [00:01<00:01, 219MB/s]
428+
61%|###### | 334M/548M [00:01<00:01, 219MB/s]
429+
65%|######4 | 355M/548M [00:01<00:00, 219MB/s]
430+
69%|######8 | 376M/548M [00:01<00:00, 219MB/s]
431+
72%|#######2 | 397M/548M [00:01<00:00, 219MB/s]
432+
76%|#######6 | 418M/548M [00:02<00:00, 219MB/s]
433+
80%|######## | 439M/548M [00:02<00:00, 219MB/s]
434+
84%|########3 | 460M/548M [00:02<00:00, 219MB/s]
435+
88%|########7 | 481M/548M [00:02<00:00, 219MB/s]
436+
92%|#########1| 502M/548M [00:02<00:00, 219MB/s]
437+
95%|#########5| 523M/548M [00:02<00:00, 219MB/s]
438+
99%|#########9| 544M/548M [00:02<00:00, 219MB/s]
439+
100%|##########| 548M/548M [00:02<00:00, 219MB/s]
439440
440441
441442
@@ -756,22 +757,22 @@ Finally, we can run the algorithm.
756757
757758
Optimizing..
758759
run [50]:
759-
Style Loss : 4.243999 Content Loss: 4.230177
760+
Style Loss : 4.124988 Content Loss: 4.180835
760761
761762
run [100]:
762-
Style Loss : 1.153091 Content Loss: 3.027826
763+
Style Loss : 1.149009 Content Loss: 3.025290
763764
764765
run [150]:
765-
Style Loss : 0.714814 Content Loss: 2.653670
766+
Style Loss : 0.722513 Content Loss: 2.658751
766767
767768
run [200]:
768-
Style Loss : 0.479303 Content Loss: 2.491420
769+
Style Loss : 0.484897 Content Loss: 2.496019
769770
770771
run [250]:
771-
Style Loss : 0.347053 Content Loss: 2.402259
772+
Style Loss : 0.348076 Content Loss: 2.404442
772773
773774
run [300]:
774-
Style Loss : 0.262986 Content Loss: 2.348989
775+
Style Loss : 0.265312 Content Loss: 2.350962
775776
776777
777778
@@ -780,7 +781,7 @@ Finally, we can run the algorithm.
780781
781782
.. rst-class:: sphx-glr-timing
782783

783-
**Total running time of the script:** ( 0 minutes 38.572 seconds)
784+
**Total running time of the script:** ( 0 minutes 38.498 seconds)
784785

785786

786787
.. _sphx_glr_download_advanced_neural_style_tutorial.py:

_sources/advanced/numpy_extensions_tutorial.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ The backward pass computes the gradient ``wrt`` the input and the gradient ``wrt
303303
304304
.. rst-class:: sphx-glr-timing
305305

306-
**Total running time of the script:** ( 0 minutes 0.602 seconds)
306+
**Total running time of the script:** ( 0 minutes 0.568 seconds)
307307

308308

309309
.. _sphx_glr_download_advanced_numpy_extensions_tutorial.py:

0 commit comments

Comments
 (0)