Open In Colab

5. Chapter 06 - Overfitting, Regularization, and Information Criteria

!pip install torch torchvision pyro-ppl proplot black blackcellmagic statsmodels patsy
Requirement already satisfied: torch in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (1.7.1)
Requirement already satisfied: torchvision in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (0.8.2)
Requirement already satisfied: pyro-ppl in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (1.3.1)
Requirement already satisfied: proplot in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (0.6.4)
Requirement already satisfied: black in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (20.8b1)
Requirement already satisfied: blackcellmagic in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (0.0.2)
Requirement already satisfied: mypy-extensions>=0.4.3 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (0.4.3)
Requirement already satisfied: typing-extensions>=3.7.4 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (3.7.4.3)
Requirement already satisfied: click>=7.1.2 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (7.1.2)
Requirement already satisfied: pathspec<1,>=0.6 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (0.8.1)
Requirement already satisfied: appdirs in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (1.4.4)
Requirement already satisfied: toml>=0.10.1 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (0.10.2)
Requirement already satisfied: typed-ast>=1.4.0 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (1.4.2)
Requirement already satisfied: regex>=2020.1.8 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (2020.11.13)
Requirement already satisfied: ipython in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from blackcellmagic) (7.19.0)
Collecting patsy
  Downloading patsy-0.5.1-py2.py3-none-any.whl (231 kB)
?25l
     |█▍                              | 10 kB 36.9 MB/s eta 0:00:01
     |██▉                             | 20 kB 40.0 MB/s eta 0:00:01
     |████▎                           | 30 kB 23.6 MB/s eta 0:00:01
     |█████▊                          | 40 kB 9.2 MB/s eta 0:00:01
     |███████                         | 51 kB 10.5 MB/s eta 0:00:01
     |████████▌                       | 61 kB 12.2 MB/s eta 0:00:01
     |██████████                      | 71 kB 11.4 MB/s eta 0:00:01
     |███████████▍                    | 81 kB 12.7 MB/s eta 0:00:01
     |████████████▊                   | 92 kB 12.2 MB/s eta 0:00:01
     |██████████████▏                 | 102 kB 10.8 MB/s eta 0:00:01
     |███████████████▋                | 112 kB 10.8 MB/s eta 0:00:01
     |█████████████████               | 122 kB 10.8 MB/s eta 0:00:01
     |██████████████████▍             | 133 kB 10.8 MB/s eta 0:00:01
     |███████████████████▉            | 143 kB 10.8 MB/s eta 0:00:01
     |█████████████████████▎          | 153 kB 10.8 MB/s eta 0:00:01
     |██████████████████████▊         | 163 kB 10.8 MB/s eta 0:00:01
     |████████████████████████        | 174 kB 10.8 MB/s eta 0:00:01
     |█████████████████████████▌      | 184 kB 10.8 MB/s eta 0:00:01
     |███████████████████████████     | 194 kB 10.8 MB/s eta 0:00:01
     |████████████████████████████▍   | 204 kB 10.8 MB/s eta 0:00:01
     |█████████████████████████████▊  | 215 kB 10.8 MB/s eta 0:00:01
     |███████████████████████████████▏| 225 kB 10.8 MB/s eta 0:00:01
     |████████████████████████████████| 231 kB 10.8 MB/s 
?25hRequirement already satisfied: numpy>=1.4 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from patsy) (1.19.5)
Requirement already satisfied: six in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from patsy) (1.15.0)
Requirement already satisfied: matplotlib in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from proplot) (3.3.3)
Requirement already satisfied: pyro-api>=0.1.1 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pyro-ppl) (0.1.2)
Requirement already satisfied: opt-einsum>=2.3.2 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pyro-ppl) (3.3.0)
Requirement already satisfied: tqdm>=4.36 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pyro-ppl) (4.56.0)
Collecting statsmodels
  Downloading statsmodels-0.12.1-cp37-cp37m-manylinux1_x86_64.whl (9.5 MB)
?25l
     |                                | 10 kB 67.8 MB/s eta 0:00:01
     |                                | 20 kB 75.6 MB/s eta 0:00:01
     |                                | 30 kB 81.7 MB/s eta 0:00:01
     |▏                               | 40 kB 71.7 MB/s eta 0:00:01
     |▏                               | 51 kB 30.3 MB/s eta 0:00:01
     |▏                               | 61 kB 31.8 MB/s eta 0:00:01
     |▎                               | 71 kB 16.5 MB/s eta 0:00:01
     |▎                               | 81 kB 17.6 MB/s eta 0:00:01
     |▎                               | 92 kB 18.9 MB/s eta 0:00:01
     |▍                               | 102 kB 18.1 MB/s eta 0:00:01
     |▍                               | 112 kB 18.1 MB/s eta 0:00:01
     |▍                               | 122 kB 18.1 MB/s eta 0:00:01
     |▌                               | 133 kB 18.1 MB/s eta 0:00:01
     |▌                               | 143 kB 18.1 MB/s eta 0:00:01
     |▌                               | 153 kB 18.1 MB/s eta 0:00:01
     |▌                               | 163 kB 18.1 MB/s eta 0:00:01
     |▋                               | 174 kB 18.1 MB/s eta 0:00:01
     |▋                               | 184 kB 18.1 MB/s eta 0:00:01
     |▋                               | 194 kB 18.1 MB/s eta 0:00:01
     |▊                               | 204 kB 18.1 MB/s eta 0:00:01
     |▊                               | 215 kB 18.1 MB/s eta 0:00:01
     |▊                               | 225 kB 18.1 MB/s eta 0:00:01
     |▉                               | 235 kB 18.1 MB/s eta 0:00:01
     |▉                               | 245 kB 18.1 MB/s eta 0:00:01
     |▉                               | 256 kB 18.1 MB/s eta 0:00:01
     |█                               | 266 kB 18.1 MB/s eta 0:00:01
     |█                               | 276 kB 18.1 MB/s eta 0:00:01
     |█                               | 286 kB 18.1 MB/s eta 0:00:01
     |█                               | 296 kB 18.1 MB/s eta 0:00:01
     |█                               | 307 kB 18.1 MB/s eta 0:00:01
     |█                               | 317 kB 18.1 MB/s eta 0:00:01
     |█                               | 327 kB 18.1 MB/s eta 0:00:01
     |█▏                              | 337 kB 18.1 MB/s eta 0:00:01
     |█▏                              | 348 kB 18.1 MB/s eta 0:00:01
     |█▏                              | 358 kB 18.1 MB/s eta 0:00:01
     |█▎                              | 368 kB 18.1 MB/s eta 0:00:01
     |█▎                              | 378 kB 18.1 MB/s eta 0:00:01
     |█▎                              | 389 kB 18.1 MB/s eta 0:00:01
     |█▍                              | 399 kB 18.1 MB/s eta 0:00:01
     |█▍                              | 409 kB 18.1 MB/s eta 0:00:01
     |█▍                              | 419 kB 18.1 MB/s eta 0:00:01
     |█▌                              | 430 kB 18.1 MB/s eta 0:00:01
     |█▌                              | 440 kB 18.1 MB/s eta 0:00:01
     |█▌                              | 450 kB 18.1 MB/s eta 0:00:01
     |█▋                              | 460 kB 18.1 MB/s eta 0:00:01
     |█▋                              | 471 kB 18.1 MB/s eta 0:00:01
     |█▋                              | 481 kB 18.1 MB/s eta 0:00:01
     |█▋                              | 491 kB 18.1 MB/s eta 0:00:01
     |█▊                              | 501 kB 18.1 MB/s eta 0:00:01
     |█▊                              | 512 kB 18.1 MB/s eta 0:00:01
     |█▊                              | 522 kB 18.1 MB/s eta 0:00:01
     |█▉                              | 532 kB 18.1 MB/s eta 0:00:01
     |█▉                              | 542 kB 18.1 MB/s eta 0:00:01
     |█▉                              | 552 kB 18.1 MB/s eta 0:00:01
     |██                              | 563 kB 18.1 MB/s eta 0:00:01
     |██                              | 573 kB 18.1 MB/s eta 0:00:01
     |██                              | 583 kB 18.1 MB/s eta 0:00:01
     |██                              | 593 kB 18.1 MB/s eta 0:00:01
     |██                              | 604 kB 18.1 MB/s eta 0:00:01
     |██                              | 614 kB 18.1 MB/s eta 0:00:01
     |██▏                             | 624 kB 18.1 MB/s eta 0:00:01
     |██▏                             | 634 kB 18.1 MB/s eta 0:00:01
     |██▏                             | 645 kB 18.1 MB/s eta 0:00:01
     |██▏                             | 655 kB 18.1 MB/s eta 0:00:01
     |██▎                             | 665 kB 18.1 MB/s eta 0:00:01
     |██▎                             | 675 kB 18.1 MB/s eta 0:00:01
     |██▎                             | 686 kB 18.1 MB/s eta 0:00:01
     |██▍                             | 696 kB 18.1 MB/s eta 0:00:01
     |██▍                             | 706 kB 18.1 MB/s eta 0:00:01
     |██▍                             | 716 kB 18.1 MB/s eta 0:00:01
     |██▌                             | 727 kB 18.1 MB/s eta 0:00:01
     |██▌                             | 737 kB 18.1 MB/s eta 0:00:01
     |██▌                             | 747 kB 18.1 MB/s eta 0:00:01
     |██▋                             | 757 kB 18.1 MB/s eta 0:00:01
     |██▋                             | 768 kB 18.1 MB/s eta 0:00:01
     |██▋                             | 778 kB 18.1 MB/s eta 0:00:01
     |██▋                             | 788 kB 18.1 MB/s eta 0:00:01
     |██▊                             | 798 kB 18.1 MB/s eta 0:00:01
     |██▊                             | 808 kB 18.1 MB/s eta 0:00:01
     |██▊                             | 819 kB 18.1 MB/s eta 0:00:01
     |██▉                             | 829 kB 18.1 MB/s eta 0:00:01
     |██▉                             | 839 kB 18.1 MB/s eta 0:00:01
     |██▉                             | 849 kB 18.1 MB/s eta 0:00:01
     |███                             | 860 kB 18.1 MB/s eta 0:00:01
     |███                             | 870 kB 18.1 MB/s eta 0:00:01
     |███                             | 880 kB 18.1 MB/s eta 0:00:01
     |███                             | 890 kB 18.1 MB/s eta 0:00:01
     |███                             | 901 kB 18.1 MB/s eta 0:00:01
     |███                             | 911 kB 18.1 MB/s eta 0:00:01
     |███▏                            | 921 kB 18.1 MB/s eta 0:00:01
     |███▏                            | 931 kB 18.1 MB/s eta 0:00:01
     |███▏                            | 942 kB 18.1 MB/s eta 0:00:01
     |███▏                            | 952 kB 18.1 MB/s eta 0:00:01
     |███▎                            | 962 kB 18.1 MB/s eta 0:00:01
     |███▎                            | 972 kB 18.1 MB/s eta 0:00:01
     |███▎                            | 983 kB 18.1 MB/s eta 0:00:01
     |███▍                            | 993 kB 18.1 MB/s eta 0:00:01
     |███▍                            | 1.0 MB 18.1 MB/s eta 0:00:01
     |███▍                            | 1.0 MB 18.1 MB/s eta 0:00:01
     |███▌                            | 1.0 MB 18.1 MB/s eta 0:00:01
     |███▌                            | 1.0 MB 18.1 MB/s eta 0:00:01
     |███▌                            | 1.0 MB 18.1 MB/s eta 0:00:01
     |███▋                            | 1.1 MB 18.1 MB/s eta 0:00:01
     |███▋                            | 1.1 MB 18.1 MB/s eta 0:00:01
     |███▋                            | 1.1 MB 18.1 MB/s eta 0:00:01
     |███▊                            | 1.1 MB 18.1 MB/s eta 0:00:01
     |███▊                            | 1.1 MB 18.1 MB/s eta 0:00:01
     |███▊                            | 1.1 MB 18.1 MB/s eta 0:00:01
     |███▊                            | 1.1 MB 18.1 MB/s eta 0:00:01
     |███▉                            | 1.1 MB 18.1 MB/s eta 0:00:01
     |███▉                            | 1.1 MB 18.1 MB/s eta 0:00:01
     |███▉                            | 1.1 MB 18.1 MB/s eta 0:00:01
     |████                            | 1.2 MB 18.1 MB/s eta 0:00:01
     |████                            | 1.2 MB 18.1 MB/s eta 0:00:01
     |████                            | 1.2 MB 18.1 MB/s eta 0:00:01
     |████                            | 1.2 MB 18.1 MB/s eta 0:00:01
     |████                            | 1.2 MB 18.1 MB/s eta 0:00:01
     |████                            | 1.2 MB 18.1 MB/s eta 0:00:01
     |████▏                           | 1.2 MB 18.1 MB/s eta 0:00:01
     |████▏                           | 1.2 MB 18.1 MB/s eta 0:00:01
     |████▏                           | 1.2 MB 18.1 MB/s eta 0:00:01
     |████▎                           | 1.2 MB 18.1 MB/s eta 0:00:01
     |████▎                           | 1.3 MB 18.1 MB/s eta 0:00:01
     |████▎                           | 1.3 MB 18.1 MB/s eta 0:00:01
     |████▎                           | 1.3 MB 18.1 MB/s eta 0:00:01
     |████▍                           | 1.3 MB 18.1 MB/s eta 0:00:01
     |████▍                           | 1.3 MB 18.1 MB/s eta 0:00:01
     |████▍                           | 1.3 MB 18.1 MB/s eta 0:00:01
     |████▌                           | 1.3 MB 18.1 MB/s eta 0:00:01
     |████▌                           | 1.3 MB 18.1 MB/s eta 0:00:01
     |████▌                           | 1.3 MB 18.1 MB/s eta 0:00:01
     |████▋                           | 1.4 MB 18.1 MB/s eta 0:00:01
     |████▋                           | 1.4 MB 18.1 MB/s eta 0:00:01
     |████▋                           | 1.4 MB 18.1 MB/s eta 0:00:01
     |████▊                           | 1.4 MB 18.1 MB/s eta 0:00:01
     |████▊                           | 1.4 MB 18.1 MB/s eta 0:00:01
     |████▊                           | 1.4 MB 18.1 MB/s eta 0:00:01
     |████▉                           | 1.4 MB 18.1 MB/s eta 0:00:01
     |████▉                           | 1.4 MB 18.1 MB/s eta 0:00:01
     |████▉                           | 1.4 MB 18.1 MB/s eta 0:00:01
     |████▉                           | 1.4 MB 18.1 MB/s eta 0:00:01
     |█████                           | 1.5 MB 18.1 MB/s eta 0:00:01
     |█████                           | 1.5 MB 18.1 MB/s eta 0:00:01
     |█████                           | 1.5 MB 18.1 MB/s eta 0:00:01
     |█████                           | 1.5 MB 18.1 MB/s eta 0:00:01
     |█████                           | 1.5 MB 18.1 MB/s eta 0:00:01
     |█████                           | 1.5 MB 18.1 MB/s eta 0:00:01
     |█████▏                          | 1.5 MB 18.1 MB/s eta 0:00:01
     |█████▏                          | 1.5 MB 18.1 MB/s eta 0:00:01
     |█████▏                          | 1.5 MB 18.1 MB/s eta 0:00:01
     |█████▎                          | 1.5 MB 18.1 MB/s eta 0:00:01
     |█████▎                          | 1.6 MB 18.1 MB/s eta 0:00:01
     |█████▎                          | 1.6 MB 18.1 MB/s eta 0:00:01
     |█████▎                          | 1.6 MB 18.1 MB/s eta 0:00:01
     |█████▍                          | 1.6 MB 18.1 MB/s eta 0:00:01
     |█████▍                          | 1.6 MB 18.1 MB/s eta 0:00:01
     |█████▍                          | 1.6 MB 18.1 MB/s eta 0:00:01
     |█████▌                          | 1.6 MB 18.1 MB/s eta 0:00:01
     |█████▌                          | 1.6 MB 18.1 MB/s eta 0:00:01
     |█████▌                          | 1.6 MB 18.1 MB/s eta 0:00:01
     |█████▋                          | 1.6 MB 18.1 MB/s eta 0:00:01
     |█████▋                          | 1.7 MB 18.1 MB/s eta 0:00:01
     |█████▋                          | 1.7 MB 18.1 MB/s eta 0:00:01
     |█████▊                          | 1.7 MB 18.1 MB/s eta 0:00:01
     |█████▊                          | 1.7 MB 18.1 MB/s eta 0:00:01
     |█████▊                          | 1.7 MB 18.1 MB/s eta 0:00:01
     |█████▉                          | 1.7 MB 18.1 MB/s eta 0:00:01
     |█████▉                          | 1.7 MB 18.1 MB/s eta 0:00:01
     |█████▉                          | 1.7 MB 18.1 MB/s eta 0:00:01
     |█████▉                          | 1.7 MB 18.1 MB/s eta 0:00:01
     |██████                          | 1.8 MB 18.1 MB/s eta 0:00:01
     |██████                          | 1.8 MB 18.1 MB/s eta 0:00:01
     |██████                          | 1.8 MB 18.1 MB/s eta 0:00:01
     |██████                          | 1.8 MB 18.1 MB/s eta 0:00:01
     |██████                          | 1.8 MB 18.1 MB/s eta 0:00:01
     |██████                          | 1.8 MB 18.1 MB/s eta 0:00:01
     |██████▏                         | 1.8 MB 18.1 MB/s eta 0:00:01
     |██████▏                         | 1.8 MB 18.1 MB/s eta 0:00:01
     |██████▏                         | 1.8 MB 18.1 MB/s eta 0:00:01
     |██████▎                         | 1.8 MB 18.1 MB/s eta 0:00:01
     |██████▎                         | 1.9 MB 18.1 MB/s eta 0:00:01
     |██████▎                         | 1.9 MB 18.1 MB/s eta 0:00:01
     |██████▍                         | 1.9 MB 18.1 MB/s eta 0:00:01
     |██████▍                         | 1.9 MB 18.1 MB/s eta 0:00:01
     |██████▍                         | 1.9 MB 18.1 MB/s eta 0:00:01
     |██████▍                         | 1.9 MB 18.1 MB/s eta 0:00:01
     |██████▌                         | 1.9 MB 18.1 MB/s eta 0:00:01
     |██████▌                         | 1.9 MB 18.1 MB/s eta 0:00:01
     |██████▌                         | 1.9 MB 18.1 MB/s eta 0:00:01
     |██████▋                         | 1.9 MB 18.1 MB/s eta 0:00:01
     |██████▋                         | 2.0 MB 18.1 MB/s eta 0:00:01
     |██████▋                         | 2.0 MB 18.1 MB/s eta 0:00:01
     |██████▊                         | 2.0 MB 18.1 MB/s eta 0:00:01
     |██████▊                         | 2.0 MB 18.1 MB/s eta 0:00:01
     |██████▊                         | 2.0 MB 18.1 MB/s eta 0:00:01
     |██████▉                         | 2.0 MB 18.1 MB/s eta 0:00:01
     |██████▉                         | 2.0 MB 18.1 MB/s eta 0:00:01
     |██████▉                         | 2.0 MB 18.1 MB/s eta 0:00:01
     |███████                         | 2.0 MB 18.1 MB/s eta 0:00:01
     |███████                         | 2.0 MB 18.1 MB/s eta 0:00:01
     |███████                         | 2.1 MB 18.1 MB/s eta 0:00:01
     |███████                         | 2.1 MB 18.1 MB/s eta 0:00:01
     |███████                         | 2.1 MB 18.1 MB/s eta 0:00:01
     |███████                         | 2.1 MB 18.1 MB/s eta 0:00:01
     |███████                         | 2.1 MB 18.1 MB/s eta 0:00:01
     |███████▏                        | 2.1 MB 18.1 MB/s eta 0:00:01
     |███████▏                        | 2.1 MB 18.1 MB/s eta 0:00:01
     |███████▏                        | 2.1 MB 18.1 MB/s eta 0:00:01
     |███████▎                        | 2.1 MB 18.1 MB/s eta 0:00:01
     |███████▎                        | 2.2 MB 18.1 MB/s eta 0:00:01
     |███████▎                        | 2.2 MB 18.1 MB/s eta 0:00:01
     |███████▍                        | 2.2 MB 18.1 MB/s eta 0:00:01
     |███████▍                        | 2.2 MB 18.1 MB/s eta 0:00:01
     |███████▍                        | 2.2 MB 18.1 MB/s eta 0:00:01
     |███████▍                        | 2.2 MB 18.1 MB/s eta 0:00:01
     |███████▌                        | 2.2 MB 18.1 MB/s eta 0:00:01
     |███████▌                        | 2.2 MB 18.1 MB/s eta 0:00:01
     |███████▌                        | 2.2 MB 18.1 MB/s eta 0:00:01
     |███████▋                        | 2.2 MB 18.1 MB/s eta 0:00:01
     |███████▋                        | 2.3 MB 18.1 MB/s eta 0:00:01
     |███████▋                        | 2.3 MB 18.1 MB/s eta 0:00:01
     |███████▊                        | 2.3 MB 18.1 MB/s eta 0:00:01
     |███████▊                        | 2.3 MB 18.1 MB/s eta 0:00:01
     |███████▊                        | 2.3 MB 18.1 MB/s eta 0:00:01
     |███████▉                        | 2.3 MB 18.1 MB/s eta 0:00:01
     |███████▉                        | 2.3 MB 18.1 MB/s eta 0:00:01
     |███████▉                        | 2.3 MB 18.1 MB/s eta 0:00:01
     |████████                        | 2.3 MB 18.1 MB/s eta 0:00:01
     |████████                        | 2.3 MB 18.1 MB/s eta 0:00:01
     |████████                        | 2.4 MB 18.1 MB/s eta 0:00:01
     |████████                        | 2.4 MB 18.1 MB/s eta 0:00:01
     |████████                        | 2.4 MB 18.1 MB/s eta 0:00:01
     |████████                        | 2.4 MB 18.1 MB/s eta 0:00:01
     |████████                        | 2.4 MB 18.1 MB/s eta 0:00:01
     |████████▏                       | 2.4 MB 18.1 MB/s eta 0:00:01
     |████████▏                       | 2.4 MB 18.1 MB/s eta 0:00:01
     |████████▏                       | 2.4 MB 18.1 MB/s eta 0:00:01
     |████████▎                       | 2.4 MB 18.1 MB/s eta 0:00:01
     |████████▎                       | 2.4 MB 18.1 MB/s eta 0:00:01
     |████████▎                       | 2.5 MB 18.1 MB/s eta 0:00:01
     |████████▍                       | 2.5 MB 18.1 MB/s eta 0:00:01
     |████████▍                       | 2.5 MB 18.1 MB/s eta 0:00:01
     |████████▍                       | 2.5 MB 18.1 MB/s eta 0:00:01
     |████████▌                       | 2.5 MB 18.1 MB/s eta 0:00:01
     |████████▌                       | 2.5 MB 18.1 MB/s eta 0:00:01
     |████████▌                       | 2.5 MB 18.1 MB/s eta 0:00:01
     |████████▌                       | 2.5 MB 18.1 MB/s eta 0:00:01
     |████████▋                       | 2.5 MB 18.1 MB/s eta 0:00:01
     |████████▋                       | 2.5 MB 18.1 MB/s eta 0:00:01
     |████████▋                       | 2.6 MB 18.1 MB/s eta 0:00:01
     |████████▊                       | 2.6 MB 18.1 MB/s eta 0:00:01
     |████████▊                       | 2.6 MB 18.1 MB/s eta 0:00:01
     |████████▊                       | 2.6 MB 18.1 MB/s eta 0:00:01
     |████████▉                       | 2.6 MB 18.1 MB/s eta 0:00:01
     |████████▉                       | 2.6 MB 18.1 MB/s eta 0:00:01
     |████████▉                       | 2.6 MB 18.1 MB/s eta 0:00:01
     |█████████                       | 2.6 MB 18.1 MB/s eta 0:00:01
     |█████████                       | 2.6 MB 18.1 MB/s eta 0:00:01
     |█████████                       | 2.7 MB 18.1 MB/s eta 0:00:01
     |█████████                       | 2.7 MB 18.1 MB/s eta 0:00:01
     |█████████                       | 2.7 MB 18.1 MB/s eta 0:00:01
     |█████████                       | 2.7 MB 18.1 MB/s eta 0:00:01
     |█████████                       | 2.7 MB 18.1 MB/s eta 0:00:01
     |█████████▏                      | 2.7 MB 18.1 MB/s eta 0:00:01
     |█████████▏                      | 2.7 MB 18.1 MB/s eta 0:00:01
     |█████████▏                      | 2.7 MB 18.1 MB/s eta 0:00:01
     |█████████▎                      | 2.7 MB 18.1 MB/s eta 0:00:01
     |█████████▎                      | 2.7 MB 18.1 MB/s eta 0:00:01
     |█████████▎                      | 2.8 MB 18.1 MB/s eta 0:00:01
     |█████████▍                      | 2.8 MB 18.1 MB/s eta 0:00:01
     |█████████▍                      | 2.8 MB 18.1 MB/s eta 0:00:01
     |█████████▍                      | 2.8 MB 18.1 MB/s eta 0:00:01
     |█████████▌                      | 2.8 MB 18.1 MB/s eta 0:00:01
     |█████████▌                      | 2.8 MB 18.1 MB/s eta 0:00:01
     |█████████▌                      | 2.8 MB 18.1 MB/s eta 0:00:01
     |█████████▋                      | 2.8 MB 18.1 MB/s eta 0:00:01
     |█████████▋                      | 2.8 MB 18.1 MB/s eta 0:00:01
     |█████████▋                      | 2.8 MB 18.1 MB/s eta 0:00:01
     |█████████▋                      | 2.9 MB 18.1 MB/s eta 0:00:01
     |█████████▊                      | 2.9 MB 18.1 MB/s eta 0:00:01
     |█████████▊                      | 2.9 MB 18.1 MB/s eta 0:00:01
     |█████████▊                      | 2.9 MB 18.1 MB/s eta 0:00:01
     |█████████▉                      | 2.9 MB 18.1 MB/s eta 0:00:01
     |█████████▉                      | 2.9 MB 18.1 MB/s eta 0:00:01
     |█████████▉                      | 2.9 MB 18.1 MB/s eta 0:00:01
     |██████████                      | 2.9 MB 18.1 MB/s eta 0:00:01
     |██████████                      | 2.9 MB 18.1 MB/s eta 0:00:01
     |██████████                      | 2.9 MB 18.1 MB/s eta 0:00:01
     |██████████                      | 3.0 MB 18.1 MB/s eta 0:00:01
     |██████████                      | 3.0 MB 18.1 MB/s eta 0:00:01
     |██████████                      | 3.0 MB 18.1 MB/s eta 0:00:01
     |██████████                      | 3.0 MB 18.1 MB/s eta 0:00:01
     |██████████▏                     | 3.0 MB 18.1 MB/s eta 0:00:01
     |██████████▏                     | 3.0 MB 18.1 MB/s eta 0:00:01
     |██████████▏                     | 3.0 MB 18.1 MB/s eta 0:00:01
     |██████████▎                     | 3.0 MB 18.1 MB/s eta 0:00:01
     |██████████▎                     | 3.0 MB 18.1 MB/s eta 0:00:01
     |██████████▎                     | 3.1 MB 18.1 MB/s eta 0:00:01
     |██████████▍                     | 3.1 MB 18.1 MB/s eta 0:00:01
     |██████████▍                     | 3.1 MB 18.1 MB/s eta 0:00:01
     |██████████▍                     | 3.1 MB 18.1 MB/s eta 0:00:01
     |██████████▌                     | 3.1 MB 18.1 MB/s eta 0:00:01
     |██████████▌                     | 3.1 MB 18.1 MB/s eta 0:00:01
     |██████████▌                     | 3.1 MB 18.1 MB/s eta 0:00:01
     |██████████▋                     | 3.1 MB 18.1 MB/s eta 0:00:01
     |██████████▋                     | 3.1 MB 18.1 MB/s eta 0:00:01
     |██████████▋                     | 3.1 MB 18.1 MB/s eta 0:00:01
     |██████████▋                     | 3.2 MB 18.1 MB/s eta 0:00:01
     |██████████▊                     | 3.2 MB 18.1 MB/s eta 0:00:01
     |██████████▊                     | 3.2 MB 18.1 MB/s eta 0:00:01
     |██████████▊                     | 3.2 MB 18.1 MB/s eta 0:00:01
     |██████████▉                     | 3.2 MB 18.1 MB/s eta 0:00:01
     |██████████▉                     | 3.2 MB 18.1 MB/s eta 0:00:01
     |██████████▉                     | 3.2 MB 18.1 MB/s eta 0:00:01
     |███████████                     | 3.2 MB 18.1 MB/s eta 0:00:01
     |███████████                     | 3.2 MB 18.1 MB/s eta 0:00:01
     |███████████                     | 3.2 MB 18.1 MB/s eta 0:00:01
     |███████████                     | 3.3 MB 18.1 MB/s eta 0:00:01
     |███████████                     | 3.3 MB 18.1 MB/s eta 0:00:01
     |███████████                     | 3.3 MB 18.1 MB/s eta 0:00:01
     |███████████▏                    | 3.3 MB 18.1 MB/s eta 0:00:01
     |███████████▏                    | 3.3 MB 18.1 MB/s eta 0:00:01
     |███████████▏                    | 3.3 MB 18.1 MB/s eta 0:00:01
     |███████████▏                    | 3.3 MB 18.1 MB/s eta 0:00:01
     |███████████▎                    | 3.3 MB 18.1 MB/s eta 0:00:01
     |███████████▎                    | 3.3 MB 18.1 MB/s eta 0:00:01
     |███████████▎                    | 3.3 MB 18.1 MB/s eta 0:00:01
     |███████████▍                    | 3.4 MB 18.1 MB/s eta 0:00:01
     |███████████▍                    | 3.4 MB 18.1 MB/s eta 0:00:01
     |███████████▍                    | 3.4 MB 18.1 MB/s eta 0:00:01
     |███████████▌                    | 3.4 MB 18.1 MB/s eta 0:00:01
     |███████████▌                    | 3.4 MB 18.1 MB/s eta 0:00:01
     |███████████▌                    | 3.4 MB 18.1 MB/s eta 0:00:01
     |███████████▋                    | 3.4 MB 18.1 MB/s eta 0:00:01
     |███████████▋                    | 3.4 MB 18.1 MB/s eta 0:00:01
     |███████████▋                    | 3.4 MB 18.1 MB/s eta 0:00:01
     |███████████▊                    | 3.5 MB 18.1 MB/s eta 0:00:01
     |███████████▊                    | 3.5 MB 18.1 MB/s eta 0:00:01
     |███████████▊                    | 3.5 MB 18.1 MB/s eta 0:00:01
     |███████████▊                    | 3.5 MB 18.1 MB/s eta 0:00:01
     |███████████▉                    | 3.5 MB 18.1 MB/s eta 0:00:01
     |███████████▉                    | 3.5 MB 18.1 MB/s eta 0:00:01
     |███████████▉                    | 3.5 MB 18.1 MB/s eta 0:00:01
     |████████████                    | 3.5 MB 18.1 MB/s eta 0:00:01
     |████████████                    | 3.5 MB 18.1 MB/s eta 0:00:01
     |████████████                    | 3.5 MB 18.1 MB/s eta 0:00:01
     |████████████                    | 3.6 MB 18.1 MB/s eta 0:00:01
     |████████████                    | 3.6 MB 18.1 MB/s eta 0:00:01
     |████████████                    | 3.6 MB 18.1 MB/s eta 0:00:01
     |████████████▏                   | 3.6 MB 18.1 MB/s eta 0:00:01
     |████████████▏                   | 3.6 MB 18.1 MB/s eta 0:00:01
     |████████████▏                   | 3.6 MB 18.1 MB/s eta 0:00:01
     |████████████▏                   | 3.6 MB 18.1 MB/s eta 0:00:01
     |████████████▎                   | 3.6 MB 18.1 MB/s eta 0:00:01
     |████████████▎                   | 3.6 MB 18.1 MB/s eta 0:00:01
     |████████████▎                   | 3.6 MB 18.1 MB/s eta 0:00:01
     |████████████▍                   | 3.7 MB 18.1 MB/s eta 0:00:01
     |████████████▍                   | 3.7 MB 18.1 MB/s eta 0:00:01
     |████████████▍                   | 3.7 MB 18.1 MB/s eta 0:00:01
     |████████████▌                   | 3.7 MB 18.1 MB/s eta 0:00:01
     |████████████▌                   | 3.7 MB 18.1 MB/s eta 0:00:01
     |████████████▌                   | 3.7 MB 18.1 MB/s eta 0:00:01
     |████████████▋                   | 3.7 MB 18.1 MB/s eta 0:00:01
     |████████████▋                   | 3.7 MB 18.1 MB/s eta 0:00:01
     |████████████▋                   | 3.7 MB 18.1 MB/s eta 0:00:01
     |████████████▊                   | 3.7 MB 18.1 MB/s eta 0:00:01
     |████████████▊                   | 3.8 MB 18.1 MB/s eta 0:00:01
     |████████████▊                   | 3.8 MB 18.1 MB/s eta 0:00:01
     |████████████▊                   | 3.8 MB 18.1 MB/s eta 0:00:01
     |████████████▉                   | 3.8 MB 18.1 MB/s eta 0:00:01
     |████████████▉                   | 3.8 MB 18.1 MB/s eta 0:00:01
     |████████████▉                   | 3.8 MB 18.1 MB/s eta 0:00:01
     |█████████████                   | 3.8 MB 18.1 MB/s eta 0:00:01
     |█████████████                   | 3.8 MB 18.1 MB/s eta 0:00:01
     |█████████████                   | 3.8 MB 18.1 MB/s eta 0:00:01
     |█████████████                   | 3.9 MB 18.1 MB/s eta 0:00:01
     |█████████████                   | 3.9 MB 18.1 MB/s eta 0:00:01
     |█████████████                   | 3.9 MB 18.1 MB/s eta 0:00:01
     |█████████████▏                  | 3.9 MB 18.1 MB/s eta 0:00:01
     |█████████████▏                  | 3.9 MB 18.1 MB/s eta 0:00:01
     |█████████████▏                  | 3.9 MB 18.1 MB/s eta 0:00:01
     |█████████████▎                  | 3.9 MB 18.1 MB/s eta 0:00:01
     |█████████████▎                  | 3.9 MB 18.1 MB/s eta 0:00:01
     |█████████████▎                  | 3.9 MB 18.1 MB/s eta 0:00:01
     |█████████████▎                  | 3.9 MB 18.1 MB/s eta 0:00:01
     |█████████████▍                  | 4.0 MB 18.1 MB/s eta 0:00:01
     |█████████████▍                  | 4.0 MB 18.1 MB/s eta 0:00:01
     |█████████████▍                  | 4.0 MB 18.1 MB/s eta 0:00:01
     |█████████████▌                  | 4.0 MB 18.1 MB/s eta 0:00:01
     |█████████████▌                  | 4.0 MB 18.1 MB/s eta 0:00:01
     |█████████████▌                  | 4.0 MB 18.1 MB/s eta 0:00:01
     |█████████████▋                  | 4.0 MB 18.1 MB/s eta 0:00:01
     |█████████████▋                  | 4.0 MB 18.1 MB/s eta 0:00:01
     |█████████████▋                  | 4.0 MB 18.1 MB/s eta 0:00:01
     |█████████████▊                  | 4.0 MB 18.1 MB/s eta 0:00:01
     |█████████████▊                  | 4.1 MB 18.1 MB/s eta 0:00:01
     |█████████████▊                  | 4.1 MB 18.1 MB/s eta 0:00:01
     |█████████████▉                  | 4.1 MB 18.1 MB/s eta 0:00:01
     |█████████████▉                  | 4.1 MB 18.1 MB/s eta 0:00:01
     |█████████████▉                  | 4.1 MB 18.1 MB/s eta 0:00:01
     |█████████████▉                  | 4.1 MB 18.1 MB/s eta 0:00:01
     |██████████████                  | 4.1 MB 18.1 MB/s eta 0:00:01
     |██████████████                  | 4.1 MB 18.1 MB/s eta 0:00:01
     |██████████████                  | 4.1 MB 18.1 MB/s eta 0:00:01
     |██████████████                  | 4.1 MB 18.1 MB/s eta 0:00:01
     |██████████████                  | 4.2 MB 18.1 MB/s eta 0:00:01
     |██████████████                  | 4.2 MB 18.1 MB/s eta 0:00:01
     |██████████████▏                 | 4.2 MB 18.1 MB/s eta 0:00:01
     |██████████████▏                 | 4.2 MB 18.1 MB/s eta 0:00:01
     |██████████████▏                 | 4.2 MB 18.1 MB/s eta 0:00:01
     |██████████████▎                 | 4.2 MB 18.1 MB/s eta 0:00:01
     |██████████████▎                 | 4.2 MB 18.1 MB/s eta 0:00:01
     |██████████████▎                 | 4.2 MB 18.1 MB/s eta 0:00:01
     |██████████████▍                 | 4.2 MB 18.1 MB/s eta 0:00:01
     |██████████████▍                 | 4.2 MB 18.1 MB/s eta 0:00:01
     |██████████████▍                 | 4.3 MB 18.1 MB/s eta 0:00:01
     |██████████████▍                 | 4.3 MB 18.1 MB/s eta 0:00:01
     |██████████████▌                 | 4.3 MB 18.1 MB/s eta 0:00:01
     |██████████████▌                 | 4.3 MB 18.1 MB/s eta 0:00:01
     |██████████████▌                 | 4.3 MB 18.1 MB/s eta 0:00:01
     |██████████████▋                 | 4.3 MB 18.1 MB/s eta 0:00:01
     |██████████████▋                 | 4.3 MB 18.1 MB/s eta 0:00:01
     |██████████████▋                 | 4.3 MB 18.1 MB/s eta 0:00:01
     |██████████████▊                 | 4.3 MB 18.1 MB/s eta 0:00:01
     |██████████████▊                 | 4.4 MB 18.1 MB/s eta 0:00:01
     |██████████████▊                 | 4.4 MB 18.1 MB/s eta 0:00:01
     |██████████████▉                 | 4.4 MB 18.1 MB/s eta 0:00:01
     |██████████████▉                 | 4.4 MB 18.1 MB/s eta 0:00:01
     |██████████████▉                 | 4.4 MB 18.1 MB/s eta 0:00:01
     |██████████████▉                 | 4.4 MB 18.1 MB/s eta 0:00:01
     |███████████████                 | 4.4 MB 18.1 MB/s eta 0:00:01
     |███████████████                 | 4.4 MB 18.1 MB/s eta 0:00:01
     |███████████████                 | 4.4 MB 18.1 MB/s eta 0:00:01
     |███████████████                 | 4.4 MB 18.1 MB/s eta 0:00:01
     |███████████████                 | 4.5 MB 18.1 MB/s eta 0:00:01
     |███████████████                 | 4.5 MB 18.1 MB/s eta 0:00:01
     |███████████████▏                | 4.5 MB 18.1 MB/s eta 0:00:01
     |███████████████▏                | 4.5 MB 18.1 MB/s eta 0:00:01
     |███████████████▏                | 4.5 MB 18.1 MB/s eta 0:00:01
     |███████████████▎                | 4.5 MB 18.1 MB/s eta 0:00:01
     |███████████████▎                | 4.5 MB 18.1 MB/s eta 0:00:01
     |███████████████▎                | 4.5 MB 18.1 MB/s eta 0:00:01
     |███████████████▍                | 4.5 MB 18.1 MB/s eta 0:00:01
     |███████████████▍                | 4.5 MB 18.1 MB/s eta 0:00:01
     |███████████████▍                | 4.6 MB 18.1 MB/s eta 0:00:01
     |███████████████▍                | 4.6 MB 18.1 MB/s eta 0:00:01
     |███████████████▌                | 4.6 MB 18.1 MB/s eta 0:00:01
     |███████████████▌                | 4.6 MB 18.1 MB/s eta 0:00:01
     |███████████████▌                | 4.6 MB 18.1 MB/s eta 0:00:01
     |███████████████▋                | 4.6 MB 18.1 MB/s eta 0:00:01
     |███████████████▋                | 4.6 MB 18.1 MB/s eta 0:00:01
     |███████████████▋                | 4.6 MB 18.1 MB/s eta 0:00:01
     |███████████████▊                | 4.6 MB 18.1 MB/s eta 0:00:01
     |███████████████▊                | 4.6 MB 18.1 MB/s eta 0:00:01
     |███████████████▊                | 4.7 MB 18.1 MB/s eta 0:00:01
     |███████████████▉                | 4.7 MB 18.1 MB/s eta 0:00:01
     |███████████████▉                | 4.7 MB 18.1 MB/s eta 0:00:01
     |███████████████▉                | 4.7 MB 18.1 MB/s eta 0:00:01
     |████████████████                | 4.7 MB 18.1 MB/s eta 0:00:01
     |████████████████                | 4.7 MB 18.1 MB/s eta 0:00:01
     |████████████████                | 4.7 MB 18.1 MB/s eta 0:00:01
     |████████████████                | 4.7 MB 18.1 MB/s eta 0:00:01
     |████████████████                | 4.7 MB 18.1 MB/s eta 0:00:01
     |████████████████                | 4.8 MB 18.1 MB/s eta 0:00:01
     |████████████████                | 4.8 MB 18.1 MB/s eta 0:00:01
     |████████████████▏               | 4.8 MB 18.1 MB/s eta 0:00:01
     |████████████████▏               | 4.8 MB 18.1 MB/s eta 0:00:01
     |████████████████▏               | 4.8 MB 18.1 MB/s eta 0:00:01
     |████████████████▎               | 4.8 MB 18.1 MB/s eta 0:00:01
     |████████████████▎               | 4.8 MB 18.1 MB/s eta 0:00:01
     |████████████████▎               | 4.8 MB 18.1 MB/s eta 0:00:01
     |████████████████▍               | 4.8 MB 18.1 MB/s eta 0:00:01
     |████████████████▍               | 4.8 MB 18.1 MB/s eta 0:00:01
     |████████████████▍               | 4.9 MB 18.1 MB/s eta 0:00:01
     |████████████████▌               | 4.9 MB 18.1 MB/s eta 0:00:01
     |████████████████▌               | 4.9 MB 18.1 MB/s eta 0:00:01
     |████████████████▌               | 4.9 MB 18.1 MB/s eta 0:00:01
     |████████████████▌               | 4.9 MB 18.1 MB/s eta 0:00:01
     |████████████████▋               | 4.9 MB 18.1 MB/s eta 0:00:01
     |████████████████▋               | 4.9 MB 18.1 MB/s eta 0:00:01
     |████████████████▋               | 4.9 MB 18.1 MB/s eta 0:00:01
     |████████████████▊               | 4.9 MB 18.1 MB/s eta 0:00:01
     |████████████████▊               | 4.9 MB 18.1 MB/s eta 0:00:01
     |████████████████▊               | 5.0 MB 18.1 MB/s eta 0:00:01
     |████████████████▉               | 5.0 MB 18.1 MB/s eta 0:00:01
     |████████████████▉               | 5.0 MB 18.1 MB/s eta 0:00:01
     |████████████████▉               | 5.0 MB 18.1 MB/s eta 0:00:01
     |█████████████████               | 5.0 MB 18.1 MB/s eta 0:00:01
     |█████████████████               | 5.0 MB 18.1 MB/s eta 0:00:01
     |█████████████████               | 5.0 MB 18.1 MB/s eta 0:00:01
     |█████████████████               | 5.0 MB 18.1 MB/s eta 0:00:01
     |█████████████████               | 5.0 MB 18.1 MB/s eta 0:00:01
     |█████████████████               | 5.0 MB 18.1 MB/s eta 0:00:01
     |█████████████████               | 5.1 MB 18.1 MB/s eta 0:00:01
     |█████████████████▏              | 5.1 MB 18.1 MB/s eta 0:00:01
     |█████████████████▏              | 5.1 MB 18.1 MB/s eta 0:00:01
     |█████████████████▏              | 5.1 MB 18.1 MB/s eta 0:00:01
     |█████████████████▎              | 5.1 MB 18.1 MB/s eta 0:00:01
     |█████████████████▎              | 5.1 MB 18.1 MB/s eta 0:00:01
     |█████████████████▎              | 5.1 MB 18.1 MB/s eta 0:00:01
     |█████████████████▍              | 5.1 MB 18.1 MB/s eta 0:00:01
     |█████████████████▍              | 5.1 MB 18.1 MB/s eta 0:00:01
     |█████████████████▍              | 5.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████▌              | 5.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████▌              | 5.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████▌              | 5.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████▌              | 5.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████▋              | 5.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████▋              | 5.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████▋              | 5.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████▊              | 5.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████▊              | 5.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████▊              | 5.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████▉              | 5.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████▉              | 5.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████▉              | 5.3 MB 18.1 MB/s eta 0:00:01
     |██████████████████              | 5.3 MB 18.1 MB/s eta 0:00:01
     |██████████████████              | 5.3 MB 18.1 MB/s eta 0:00:01
     |██████████████████              | 5.3 MB 18.1 MB/s eta 0:00:01
     |██████████████████              | 5.3 MB 18.1 MB/s eta 0:00:01
     |██████████████████              | 5.3 MB 18.1 MB/s eta 0:00:01
     |██████████████████              | 5.3 MB 18.1 MB/s eta 0:00:01
     |██████████████████              | 5.4 MB 18.1 MB/s eta 0:00:01
     |██████████████████▏             | 5.4 MB 18.1 MB/s eta 0:00:01
     |██████████████████▏             | 5.4 MB 18.1 MB/s eta 0:00:01
     |██████████████████▏             | 5.4 MB 18.1 MB/s eta 0:00:01
     |██████████████████▎             | 5.4 MB 18.1 MB/s eta 0:00:01
     |██████████████████▎             | 5.4 MB 18.1 MB/s eta 0:00:01
     |██████████████████▎             | 5.4 MB 18.1 MB/s eta 0:00:01
     |██████████████████▍             | 5.4 MB 18.1 MB/s eta 0:00:01
     |██████████████████▍             | 5.4 MB 18.1 MB/s eta 0:00:01
     |██████████████████▍             | 5.4 MB 18.1 MB/s eta 0:00:01
     |██████████████████▌             | 5.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████▌             | 5.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████▌             | 5.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████▋             | 5.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████▋             | 5.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████▋             | 5.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████▋             | 5.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████▊             | 5.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████▊             | 5.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████▊             | 5.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████▉             | 5.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████▉             | 5.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████▉             | 5.6 MB 18.1 MB/s eta 0:00:01
     |███████████████████             | 5.6 MB 18.1 MB/s eta 0:00:01
     |███████████████████             | 5.6 MB 18.1 MB/s eta 0:00:01
     |███████████████████             | 5.6 MB 18.1 MB/s eta 0:00:01
     |███████████████████             | 5.6 MB 18.1 MB/s eta 0:00:01
     |███████████████████             | 5.6 MB 18.1 MB/s eta 0:00:01
     |███████████████████             | 5.6 MB 18.1 MB/s eta 0:00:01
     |███████████████████▏            | 5.7 MB 18.1 MB/s eta 0:00:01
     |███████████████████▏            | 5.7 MB 18.1 MB/s eta 0:00:01
     |███████████████████▏            | 5.7 MB 18.1 MB/s eta 0:00:01
     |███████████████████▏            | 5.7 MB 18.1 MB/s eta 0:00:01
     |███████████████████▎            | 5.7 MB 18.1 MB/s eta 0:00:01
     |███████████████████▎            | 5.7 MB 18.1 MB/s eta 0:00:01
     |███████████████████▎            | 5.7 MB 18.1 MB/s eta 0:00:01
     |███████████████████▍            | 5.7 MB 18.1 MB/s eta 0:00:01
     |███████████████████▍            | 5.7 MB 18.1 MB/s eta 0:00:01
     |███████████████████▍            | 5.7 MB 18.1 MB/s eta 0:00:01
     |███████████████████▌            | 5.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████▌            | 5.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████▌            | 5.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████▋            | 5.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████▋            | 5.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████▋            | 5.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████▋            | 5.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████▊            | 5.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████▊            | 5.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████▊            | 5.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████▉            | 5.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████▉            | 5.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████▉            | 5.9 MB 18.1 MB/s eta 0:00:01
     |████████████████████            | 5.9 MB 18.1 MB/s eta 0:00:01
     |████████████████████            | 5.9 MB 18.1 MB/s eta 0:00:01
     |████████████████████            | 5.9 MB 18.1 MB/s eta 0:00:01
     |████████████████████            | 5.9 MB 18.1 MB/s eta 0:00:01
     |████████████████████            | 5.9 MB 18.1 MB/s eta 0:00:01
     |████████████████████            | 5.9 MB 18.1 MB/s eta 0:00:01
     |████████████████████▏           | 5.9 MB 18.1 MB/s eta 0:00:01
     |████████████████████▏           | 6.0 MB 18.1 MB/s eta 0:00:01
     |████████████████████▏           | 6.0 MB 18.1 MB/s eta 0:00:01
     |████████████████████▏           | 6.0 MB 18.1 MB/s eta 0:00:01
     |████████████████████▎           | 6.0 MB 18.1 MB/s eta 0:00:01
     |████████████████████▎           | 6.0 MB 18.1 MB/s eta 0:00:01
     |████████████████████▎           | 6.0 MB 18.1 MB/s eta 0:00:01
     |████████████████████▍           | 6.0 MB 18.1 MB/s eta 0:00:01
     |████████████████████▍           | 6.0 MB 18.1 MB/s eta 0:00:01
     |████████████████████▍           | 6.0 MB 18.1 MB/s eta 0:00:01
     |████████████████████▌           | 6.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████▌           | 6.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████▌           | 6.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████▋           | 6.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████▋           | 6.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████▋           | 6.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████▊           | 6.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████▊           | 6.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████▊           | 6.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████▊           | 6.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████▉           | 6.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████▉           | 6.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████▉           | 6.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████████           | 6.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████████           | 6.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████████           | 6.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████████           | 6.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████████           | 6.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████████           | 6.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▏          | 6.2 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▏          | 6.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▏          | 6.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▎          | 6.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▎          | 6.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▎          | 6.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▎          | 6.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▍          | 6.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▍          | 6.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▍          | 6.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▌          | 6.3 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▌          | 6.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▌          | 6.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▋          | 6.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▋          | 6.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▋          | 6.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▊          | 6.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▊          | 6.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▊          | 6.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▊          | 6.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▉          | 6.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▉          | 6.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████▉          | 6.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████████          | 6.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████████          | 6.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████████          | 6.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████████          | 6.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████████          | 6.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████████          | 6.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▏         | 6.5 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▏         | 6.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▏         | 6.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▎         | 6.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▎         | 6.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▎         | 6.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▎         | 6.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▍         | 6.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▍         | 6.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▍         | 6.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▌         | 6.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▌         | 6.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▌         | 6.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▋         | 6.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▋         | 6.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▋         | 6.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▊         | 6.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▊         | 6.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▊         | 6.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▉         | 6.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▉         | 6.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▉         | 6.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████▉         | 6.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████████         | 6.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████████         | 6.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████████         | 6.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████████         | 6.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████████         | 6.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████████         | 6.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▏        | 6.8 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▏        | 6.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▏        | 6.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▎        | 6.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▎        | 6.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▎        | 6.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▍        | 6.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▍        | 6.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▍        | 6.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▍        | 6.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▌        | 6.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▌        | 7.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▌        | 7.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▋        | 7.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▋        | 7.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▋        | 7.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▊        | 7.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▊        | 7.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▊        | 7.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▉        | 7.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▉        | 7.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████▉        | 7.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████████        | 7.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████████        | 7.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████████        | 7.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████████        | 7.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████████        | 7.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████████        | 7.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████████        | 7.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▏       | 7.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▏       | 7.1 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▏       | 7.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▎       | 7.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▎       | 7.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▎       | 7.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▍       | 7.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▍       | 7.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▍       | 7.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▍       | 7.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▌       | 7.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▌       | 7.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▌       | 7.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▋       | 7.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▋       | 7.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▋       | 7.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▊       | 7.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▊       | 7.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▊       | 7.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▉       | 7.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▉       | 7.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████▉       | 7.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████       | 7.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████       | 7.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████       | 7.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████       | 7.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████       | 7.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████       | 7.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████       | 7.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▏      | 7.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▏      | 7.4 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▏      | 7.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▎      | 7.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▎      | 7.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▎      | 7.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▍      | 7.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▍      | 7.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▍      | 7.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▌      | 7.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▌      | 7.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▌      | 7.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▌      | 7.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▋      | 7.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▋      | 7.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▋      | 7.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▊      | 7.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▊      | 7.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▊      | 7.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▉      | 7.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▉      | 7.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████▉      | 7.6 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████      | 7.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████      | 7.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████      | 7.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████      | 7.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████      | 7.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████      | 7.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████      | 7.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▏     | 7.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▏     | 7.7 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▏     | 7.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▎     | 7.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▎     | 7.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▎     | 7.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▍     | 7.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▍     | 7.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▍     | 7.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▌     | 7.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▌     | 7.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▌     | 7.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▌     | 7.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▋     | 7.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▋     | 7.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▋     | 7.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▊     | 7.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▊     | 7.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▊     | 7.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▉     | 7.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▉     | 7.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████▉     | 7.9 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████     | 8.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████     | 8.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████     | 8.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████     | 8.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████     | 8.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████     | 8.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████     | 8.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▏    | 8.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▏    | 8.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▏    | 8.0 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▎    | 8.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▎    | 8.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▎    | 8.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▍    | 8.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▍    | 8.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▍    | 8.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▌    | 8.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▌    | 8.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▌    | 8.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▋    | 8.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▋    | 8.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▋    | 8.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▋    | 8.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▊    | 8.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▊    | 8.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▊    | 8.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▉    | 8.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▉    | 8.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████▉    | 8.2 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████    | 8.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████    | 8.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████    | 8.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████    | 8.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████    | 8.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████    | 8.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▏   | 8.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▏   | 8.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▏   | 8.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▏   | 8.3 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▎   | 8.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▎   | 8.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▎   | 8.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▍   | 8.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▍   | 8.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▍   | 8.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▌   | 8.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▌   | 8.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▌   | 8.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▋   | 8.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▋   | 8.5 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▋   | 8.5 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▊   | 8.5 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▊   | 8.5 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▊   | 8.5 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▊   | 8.5 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▉   | 8.5 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▉   | 8.5 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████▉   | 8.5 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████   | 8.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████   | 8.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████   | 8.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████   | 8.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████   | 8.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████   | 8.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▏  | 8.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▏  | 8.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▏  | 8.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▏  | 8.6 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▎  | 8.7 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▎  | 8.7 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▎  | 8.7 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▍  | 8.7 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▍  | 8.7 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▍  | 8.7 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▌  | 8.7 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▌  | 8.7 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▌  | 8.7 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▋  | 8.7 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▋  | 8.8 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▋  | 8.8 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▊  | 8.8 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▊  | 8.8 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▊  | 8.8 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▊  | 8.8 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▉  | 8.8 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▉  | 8.8 MB 18.1 MB/s eta 0:00:01
     |█████████████████████████████▉  | 8.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████  | 8.8 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████  | 8.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████  | 8.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████  | 8.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████  | 8.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████  | 8.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▏ | 8.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▏ | 8.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▏ | 8.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▎ | 8.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▎ | 8.9 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▎ | 9.0 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▎ | 9.0 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▍ | 9.0 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▍ | 9.0 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▍ | 9.0 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▌ | 9.0 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▌ | 9.0 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▌ | 9.0 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▋ | 9.0 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▋ | 9.1 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▋ | 9.1 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▊ | 9.1 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▊ | 9.1 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▊ | 9.1 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▉ | 9.1 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▉ | 9.1 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▉ | 9.1 MB 18.1 MB/s eta 0:00:01
     |██████████████████████████████▉ | 9.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████ | 9.1 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████ | 9.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████ | 9.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████ | 9.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████ | 9.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████ | 9.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▏| 9.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▏| 9.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▏| 9.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▎| 9.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▎| 9.2 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▎| 9.3 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▎| 9.3 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▍| 9.3 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▍| 9.3 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▍| 9.3 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▌| 9.3 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▌| 9.3 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▌| 9.3 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▋| 9.3 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▋| 9.3 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▋| 9.4 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▊| 9.4 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▊| 9.4 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▊| 9.4 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▉| 9.4 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▉| 9.4 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▉| 9.4 MB 18.1 MB/s eta 0:00:01
     |███████████████████████████████▉| 9.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████████| 9.4 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████████| 9.5 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████████| 9.5 MB 18.1 MB/s eta 0:00:01
     |████████████████████████████████| 9.5 MB 18.1 MB/s 
?25hRequirement already satisfied: pandas>=0.21 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from statsmodels) (1.1.5)
Requirement already satisfied: scipy>=1.1 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from statsmodels) (1.5.4)
Requirement already satisfied: python-dateutil>=2.7.3 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pandas>=0.21->statsmodels) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pandas>=0.21->statsmodels) (2020.5)
Requirement already satisfied: pillow>=4.1.1 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from torchvision) (8.1.0)
Requirement already satisfied: setuptools>=18.5 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (47.1.0)
Requirement already satisfied: backcall in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (0.2.0)
Requirement already satisfied: decorator in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (4.4.2)
Requirement already satisfied: traitlets>=4.2 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (5.0.5)
Requirement already satisfied: pygments in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (2.7.4)
Requirement already satisfied: pickleshare in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (0.7.5)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (3.0.10)
Requirement already satisfied: pexpect>4.3 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (4.8.0)
Requirement already satisfied: jedi>=0.10 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (0.18.0)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from jedi>=0.10->ipython->blackcellmagic) (0.8.1)
Requirement already satisfied: ptyprocess>=0.5 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pexpect>4.3->ipython->blackcellmagic) (0.7.0)
Requirement already satisfied: wcwidth in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->blackcellmagic) (0.2.5)
Requirement already satisfied: ipython-genutils in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from traitlets>=4.2->ipython->blackcellmagic) (0.2.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from matplotlib->proplot) (2.4.7)
Requirement already satisfied: kiwisolver>=1.0.1 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from matplotlib->proplot) (1.3.1)
Requirement already satisfied: cycler>=0.10 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from matplotlib->proplot) (0.10.0)
Installing collected packages: patsy, statsmodels
Successfully installed patsy-0.5.1 statsmodels-0.12.1
%load_ext blackcellmagic
import warnings

import pandas as pd
import proplot as plot
import pyro
import pyro.distributions as dist
import pyro.infer
import pyro.ops.stats as stats
import pyro.optim
import seaborn as sns
import torch
import torch.distributions.constraints as constraints
import torch.tensor as tensor
from pyro.contrib.autoguide import AutoLaplaceApproximation

warnings.filterwarnings("ignore")
%pylab inline
pyro.set_rng_seed(42)

plt.rcParams["axes.labelweight"] = "bold"
plt.rcParams["font.weight"] = "bold"
Populating the interactive namespace from numpy and matplotlib

5.1. Code 6.1

!pip install torch torchvision pyro-ppl proplot black blackcellmagic statsmodels patsy
Requirement already satisfied: torch in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (1.7.1)
Requirement already satisfied: torchvision in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (0.8.2)
Requirement already satisfied: pyro-ppl in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (1.3.1)
Requirement already satisfied: proplot in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (0.6.4)
Requirement already satisfied: black in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (20.8b1)
Requirement already satisfied: blackcellmagic in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (0.0.2)
Requirement already satisfied: statsmodels in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (0.12.1)
Requirement already satisfied: patsy in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (0.5.1)
Requirement already satisfied: appdirs in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (1.4.4)
Requirement already satisfied: typed-ast>=1.4.0 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (1.4.2)
Requirement already satisfied: toml>=0.10.1 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (0.10.2)
Requirement already satisfied: pathspec<1,>=0.6 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (0.8.1)
Requirement already satisfied: mypy-extensions>=0.4.3 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (0.4.3)
Requirement already satisfied: typing-extensions>=3.7.4 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (3.7.4.3)
Requirement already satisfied: regex>=2020.1.8 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (2020.11.13)
Requirement already satisfied: click>=7.1.2 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from black) (7.1.2)
Requirement already satisfied: ipython in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from blackcellmagic) (7.19.0)
Requirement already satisfied: numpy>=1.4 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from patsy) (1.19.5)
Requirement already satisfied: six in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from patsy) (1.15.0)
Requirement already satisfied: matplotlib in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from proplot) (3.3.3)
Requirement already satisfied: pyro-api>=0.1.1 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pyro-ppl) (0.1.2)
Requirement already satisfied: opt-einsum>=2.3.2 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pyro-ppl) (3.3.0)
Requirement already satisfied: tqdm>=4.36 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pyro-ppl) (4.56.0)
Requirement already satisfied: scipy>=1.1 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from statsmodels) (1.5.4)
Requirement already satisfied: pandas>=0.21 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from statsmodels) (1.1.5)
Requirement already satisfied: python-dateutil>=2.7.3 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pandas>=0.21->statsmodels) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pandas>=0.21->statsmodels) (2020.5)
Requirement already satisfied: pillow>=4.1.1 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from torchvision) (8.1.0)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (3.0.10)
Requirement already satisfied: pygments in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (2.7.4)
Requirement already satisfied: jedi>=0.10 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (0.18.0)
Requirement already satisfied: backcall in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (0.2.0)
Requirement already satisfied: setuptools>=18.5 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (47.1.0)
Requirement already satisfied: decorator in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (4.4.2)
Requirement already satisfied: traitlets>=4.2 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (5.0.5)
Requirement already satisfied: pickleshare in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (0.7.5)
Requirement already satisfied: pexpect>4.3 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from ipython->blackcellmagic) (4.8.0)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from jedi>=0.10->ipython->blackcellmagic) (0.8.1)
Requirement already satisfied: ptyprocess>=0.5 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from pexpect>4.3->ipython->blackcellmagic) (0.7.0)
Requirement already satisfied: wcwidth in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->blackcellmagic) (0.2.5)
Requirement already satisfied: ipython-genutils in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from traitlets>=4.2->ipython->blackcellmagic) (0.2.0)
Requirement already satisfied: cycler>=0.10 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from matplotlib->proplot) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from matplotlib->proplot) (1.3.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages (from matplotlib->proplot) (2.4.7)
import pandas as pd
import torch
import torch.tensor as tensor
import pyro
import pyro.distributions as dist
from pyro.infer import SVI, Trace_ELBO
from pyro.infer.autoguide import AutoDiagonalNormal

sppnames = ["afarensis", "africanus", "habilis", "boisei", "rudolfensis", "ergaster", "sapiens"]
brainvolcc = [438., 452., 612., 521., 752., 871., 1350.]
masskg = [37.0, 35.5, 34.5, 41.5, 55.5, 61.0, 53.5]
d = pd.DataFrame({"species": sppnames, "brain":brainvolcc, "mass": masskg})
brain = tensor(d['brain'], dtype=torch.float)
mass = tensor(d['mass'], dtype=torch.float)


def modelLM(x, y):
  sigma = 1.
  weight = pyro.sample("weight", dist.Normal(0., 100.))
  y_pred = weight * x
  bias = pyro.sample("bias", dist.Normal(x.mean(), 100.))
  y_pred = y_pred + bias
  y = pyro.sample("y", dist.Normal(y_pred, sigma), obs=y)
  return y

adam = pyro.optim.Adam({"lr": 0.03})
guide = AutoDiagonalNormal(modelLM)

svi = SVI(modelLM, guide, adam, loss=Trace_ELBO())
num_iterations = 5000
pyro.clear_param_store()
losses = []
for j in range(num_iterations):
    # calculate the loss and take a gradient step
    loss = svi.step(mass, brain)
    if j % 100 == 0:
        print("[iteration %04d] loss: %.4f" % (j + 1, loss / len(brain)))
    losses.append(loss)
guide.requires_grad_(False)

guide.quantiles([0.25, 0.5, 0.75])
[iteration 0001] loss: 124733.5842
[iteration 0101] loss: 74004.5850
[iteration 0201] loss: 46515.2258
[iteration 0301] loss: 33109.2908
[iteration 0401] loss: 27733.2381
[iteration 0501] loss: 25618.5655
[iteration 0601] loss: 25289.5729
[iteration 0701] loss: 25034.2776
[iteration 0801] loss: 25023.3285
[iteration 0901] loss: 25029.7554
[iteration 1001] loss: 25011.1490
[iteration 1101] loss: 25016.0217
[iteration 1201] loss: 25000.9326
[iteration 1301] loss: 24994.1032
[iteration 1401] loss: 24990.6076
[iteration 1501] loss: 24994.1014
[iteration 1601] loss: 24983.2122
[iteration 1701] loss: 24964.5205
[iteration 1801] loss: 24964.6162
[iteration 1901] loss: 24955.8795
[iteration 2001] loss: 24942.3134
[iteration 2101] loss: 24938.5913
[iteration 2201] loss: 24925.3585
[iteration 2301] loss: 24914.7629
[iteration 2401] loss: 24908.6418
[iteration 2501] loss: 24897.4198
[iteration 2601] loss: 24888.7264
[iteration 2701] loss: 24867.3429
[iteration 2801] loss: 24856.0297
[iteration 2901] loss: 24854.7172
[iteration 3001] loss: 24833.0281
[iteration 3101] loss: 24813.5586
[iteration 3201] loss: 24803.6557
[iteration 3301] loss: 24781.8582
[iteration 3401] loss: 24767.0788
[iteration 3501] loss: 24755.1060
[iteration 3601] loss: 24736.5595
[iteration 3701] loss: 24721.7683
[iteration 3801] loss: 24695.6219
[iteration 3901] loss: 24679.6698
[iteration 4001] loss: 24659.0096
[iteration 4101] loss: 24635.8537
[iteration 4201] loss: 24614.3647
[iteration 4301] loss: 24589.9905
[iteration 4401] loss: 24576.6697
[iteration 4501] loss: 24559.9562
[iteration 4601] loss: 24531.1038
[iteration 4701] loss: 24516.1180
[iteration 4801] loss: 24486.0372
[iteration 4901] loss: 24467.1129
{'weight': [tensor(14.9593), tensor(14.9719), tensor(14.9846)],
 'bias': [tensor(44.7712), tensor(44.9555), tensor(45.1398)]}
guide.requires_grad_(False)

for name, value in pyro.get_param_store().items():
    print(name, pyro.param(name))
guide.quantiles([0.25, 0.5, 0.75])
AutoDiagonalNormal.loc Parameter containing:
tensor([14.9719, 44.9555])
AutoDiagonalNormal.scale tensor([0.0187, 0.2732])
{'weight': [tensor(14.9593), tensor(14.9719), tensor(14.9846)],
 'bias': [tensor(44.7712), tensor(44.9555), tensor(45.1398)]}
def modelLM(x, data):
  #sigma = pyro.sample("sigma", dist.HalfCauchy(2.))
  
  sigma = pyro.sample("sigma", dist.Uniform(0., 10.))
  weight = pyro.sample("weight", dist.Normal(0., 1.))
  wx = weight *x 
  #if intercept:
  bias = pyro.sample("bias", dist.Normal(0, 10.))
  wx += bias
  y = pyro.sample("y", dist.Normal(wx, sigma), obs=data)
  return y

def guideLM(x, data):
  mean_weight_param = pyro.param("mean_weight_param", tensor(1.))
  scale_weight_param = pyro.param("scale_weight_param", tensor(1.))
  mean_bias_param = pyro.param("mean_bias_param", x.mean())
  scale_bias_param = pyro.param("scale_bias_param", tensor(20.))
  pyro.sample("weight", dist.Normal(mean_weight_param, scale_weight_param))
  pyro.sample("bias", dist.Normal(mean_bias_param, scale_bias_param))
  #pass
  """
  weight_param = pyro.param("weight_param", tensor(1.)
    )
  bias_param = pyro.param("bias_param", tensor(x.mean())
    )
  sigma_param = pyro.param(
              "sigma_param", tensor(1.), constraint=constraints.positive
    )
  return pyro.sample("weight", dist.Delta(weight_param)), pyro.sample("bias", dist.Delta(bias_param)), pyro.sample("sigma", dist.Delta(sigma_param))
  """


brain = tensor(d['brain'], dtype=torch.float)
mass = tensor(d['mass'], dtype=torch.float)

pyro.clear_param_store()
conditionedLM = pyro.condition(modelLM, data={"y": brain})
svi = pyro.infer.SVI(model=conditionedLM,
                     guide=guideLM,
                     optim=pyro.optim.Adam({"lr": 0.001}),
                     loss=pyro.infer.Trace_ELBO())

num_steps = 10000
losses = [svi.step(mass, brain) for t in range(num_steps)]
plt.plot(losses)
[<matplotlib.lines.Line2D at 0x7fcca5d5b550>]
../_images/06_Chapter06_8_1.png
from pyro.infer import SVI, Trace_ELBO
from pyro.infer.autoguide import AutoDiagonalNormal

def modelLM(x, data):
  sigma = 1.
  bias = pyro.sample("bias", dist.Normal(x.mean(), 100.))
  weight = pyro.sample("weight", dist.Normal(0., 1.))
  wx = bias + weight * x#(x-x.mean()) 
  y = pyro.sample("y", dist.Normal(wx, sigma), obs=data)
  return wx

brain = tensor(d['brain'], dtype=torch.float)
mass = tensor(d['mass'], dtype=torch.float)

adam = pyro.optim.Adam({"lr": 0.1})
guide = AutoDiagonalNormal(modelLM)

svi = SVI(modelLM, guide, adam, loss=Trace_ELBO())
num_iterations = 5000
pyro.clear_param_store()
losses = []
for j in range(num_iterations):
    # calculate the loss and take a gradient step
    loss = svi.step(mass, brain)
    if j % 100 == 0:
        print("[iteration %04d] loss: %.4f" % (j + 1, loss / len(brain)))
    losses.append(loss)
plt.plot(losses)
[iteration 0001] loss: 325443.0306
[iteration 0101] loss: 86196.9799
[iteration 0201] loss: 30485.7286
[iteration 0301] loss: 24183.2539
[iteration 0401] loss: 23718.8910
[iteration 0501] loss: 23753.0312
[iteration 0601] loss: 23713.7665
[iteration 0701] loss: 23707.4428
[iteration 0801] loss: 23696.3865
[iteration 0901] loss: 23689.9150
[iteration 1001] loss: 23686.0264
[iteration 1101] loss: 23676.1150
[iteration 1201] loss: 23673.7160
[iteration 1301] loss: 23665.9799
[iteration 1401] loss: 23654.5505
[iteration 1501] loss: 23650.4402
[iteration 1601] loss: 23636.7607
[iteration 1701] loss: 23630.7053
[iteration 1801] loss: 23614.8094
[iteration 1901] loss: 23612.0588
[iteration 2001] loss: 23599.0467
[iteration 2101] loss: 23589.3469
[iteration 2201] loss: 23580.1197
[iteration 2301] loss: 23565.1825
[iteration 2401] loss: 23554.5085
[iteration 2501] loss: 23543.7427
[iteration 2601] loss: 23530.2560
[iteration 2701] loss: 23514.2699
[iteration 2801] loss: 23500.3823
[iteration 2901] loss: 23488.2888
[iteration 3001] loss: 23464.1900
[iteration 3101] loss: 23452.9816
[iteration 3201] loss: 23436.2266
[iteration 3301] loss: 23418.8576
[iteration 3401] loss: 23402.7113
[iteration 3501] loss: 23387.5023
[iteration 3601] loss: 23368.4711
[iteration 3701] loss: 23352.3340
[iteration 3801] loss: 23332.7340
[iteration 3901] loss: 23314.9820
[iteration 4001] loss: 23297.6411
[iteration 4101] loss: 23275.3116
[iteration 4201] loss: 23257.3966
[iteration 4301] loss: 23235.1549
[iteration 4401] loss: 23220.3387
[iteration 4501] loss: 23198.2184
[iteration 4601] loss: 23177.3216
[iteration 4701] loss: 23158.4120
[iteration 4801] loss: 23135.5218
[iteration 4901] loss: 23115.7369
[<matplotlib.lines.Line2D at 0x7fcca5261590>]
../_images/06_Chapter06_9_51.png
mass.mean()
tensor(45.5000)
guide.requires_grad_(False)

for name, value in pyro.get_param_store().items():
    print(name, pyro.param(name))
guide.quantiles([0.25, 0.5, 0.75])
AutoDiagonalNormal.loc Parameter containing:
tensor([-100.1629,   18.0064])
AutoDiagonalNormal.scale tensor([0.9137, 0.0137])
{'bias': [tensor(-100.7792), tensor(-100.1629), tensor(-99.5466)],
 'weight': [tensor(17.9971), tensor(18.0064), tensor(18.0156)]}
guide.requires_grad_(False)

for name, value in pyro.get_param_store().items():
    print(name, pyro.param(name))
guide.quantiles([0.25, 0.5, 0.75])
AutoDiagonalNormal.loc Parameter containing:
tensor([-100.1629,   18.0064])
AutoDiagonalNormal.scale tensor([0.9137, 0.0137])
{'bias': [tensor(-100.7792), tensor(-100.1629), tensor(-99.5466)],
 'weight': [tensor(17.9971), tensor(18.0064), tensor(18.0156)]}
from pyro.nn import PyroSample
from torch import nn
from pyro.nn import PyroModule
from pyro.infer.autoguide import AutoDiagonalNormal


class BayesianRegression(PyroModule):
    def __init__(self, in_features, out_features):
        super().__init__()
        self.linear = PyroModule[nn.Linear](in_features, out_features)
        self.linear.weight = PyroSample(dist.Normal(0., 1.).expand([out_features, in_features]).to_event(2))
        self.linear.bias = PyroSample(dist.Normal(0., 100.).expand([out_features]).to_event(1))

    def forward(self, x, y=None):
        sigma = 1.#pyro.sample("sigma", dist.Uniform(0., 1.))
        mean = self.linear(x).squeeze(-1)
        with pyro.plate("data", x.shape[0]):
            obs = pyro.sample("obs", dist.Normal(mean, sigma), obs=y)
        return mean

brain = tensor(d['brain'], dtype=torch.float).reshape(7,1)
mass = tensor(d['mass'], dtype=torch.float).reshape(7,1)

model = BayesianRegression(1, 1)
guide = AutoDiagonalNormal(model)
adam = pyro.optim.Adam({"lr": 0.03})
svi = SVI(model, guide, adam, loss=Trace_ELBO())
pyro.clear_param_store()
for j in range(num_iterations):
    # calculate the loss and take a gradient step
    loss = svi.step(mass, brain)
    if j % 100 == 0:
        print("[iteration %04d] loss: %.4f" % (j + 1, loss / len(brain)))
[iteration 0001] loss: 2280797.1426
[iteration 0101] loss: 1612431.2591
[iteration 0201] loss: 1151337.9388
[iteration 0301] loss: 857165.6141
[iteration 0401] loss: 684532.3046
[iteration 0501] loss: 574005.8696
[iteration 0601] loss: 471863.2086
[iteration 0701] loss: 429997.8499
[iteration 0801] loss: 414210.7250
[iteration 0901] loss: 408141.8160
[iteration 1001] loss: 404559.5270
[iteration 1101] loss: 402967.1697
[iteration 1201] loss: 402883.9007
[iteration 1301] loss: 402498.4033
[iteration 1401] loss: 402507.9447
[iteration 1501] loss: 402326.1818
[iteration 1601] loss: 402007.1437
[iteration 1701] loss: 402255.8419
[iteration 1801] loss: 402565.5256
[iteration 1901] loss: 401843.3569
[iteration 2001] loss: 401691.6365
[iteration 2101] loss: 401838.3531
[iteration 2201] loss: 401438.3765
[iteration 2301] loss: 401275.7682
[iteration 2401] loss: 400948.3761
[iteration 2501] loss: 400918.8117
[iteration 2601] loss: 400662.1749
[iteration 2701] loss: 400352.9827
[iteration 2801] loss: 400331.6692
[iteration 2901] loss: 399970.3530
[iteration 3001] loss: 399576.0091
[iteration 3101] loss: 399251.3846
[iteration 3201] loss: 399010.6192
[iteration 3301] loss: 398913.3971
[iteration 3401] loss: 398508.1008
[iteration 3501] loss: 398325.2167
[iteration 3601] loss: 398437.7214
[iteration 3701] loss: 397630.5818
[iteration 3801] loss: 397207.0400
[iteration 3901] loss: 396777.9219
[iteration 4001] loss: 396541.2238
[iteration 4101] loss: 396146.8030
[iteration 4201] loss: 395647.8179
[iteration 4301] loss: 395397.7329
[iteration 4401] loss: 395026.4361
[iteration 4501] loss: 394518.2253
[iteration 4601] loss: 394103.0655
[iteration 4701] loss: 393694.0898
[iteration 4801] loss: 393157.0105
[iteration 4901] loss: 392731.0847
guide.requires_grad_(False)

for name, value in pyro.get_param_store().items():
    print(name, pyro.param(name))
guide.quantiles([0.25, 0.5, 0.75])
AutoDiagonalNormal.loc Parameter containing:
tensor([14.6845, 13.0673])
AutoDiagonalNormal.scale tensor([0.0250, 0.6258])
{'linear.weight': [tensor([[14.6677]]),
  tensor([[14.6845]]),
  tensor([[14.7014]])],
 'linear.bias': [tensor([12.6452]), tensor([13.0673]), tensor([13.4895])]}
DATA_URL = "https://d2hg8soec8ck9v.cloudfront.net/datasets/rugged_data.csv"
data = pd.read_csv(DATA_URL, encoding="ISO-8859-1")
df = data[["cont_africa", "rugged", "rgdppc_2000"]]
df = df[np.isfinite(df.rgdppc_2000)]
df["rgdppc_2000"] = np.log(df["rgdppc_2000"])
df["cont_africa_x_rugged"] = df["cont_africa"] * df["rugged"]
data = torch.tensor(df[["cont_africa", "rugged", "cont_africa_x_rugged", "rgdppc_2000"]].values,
                        dtype=torch.float)
x_data, y_data = data[:, :-1], data[:, -1]

x_data.shape
torch.Size([170, 3])
mass#.shape
tensor([[37.0000],
        [35.5000],
        [34.5000],
        [41.5000],
        [55.5000],
        [61.0000],
        [53.5000]])
brain
tensor([[ 438.],
        [ 452.],
        [ 612.],
        [ 521.],
        [ 752.],
        [ 871.],
        [1350.]])
print("weight = ", pyro.param("mean_weight_param").item())
print("bias = ", pyro.param("mean_bias_param").item())
#print("sigma = ", pyro.param("sigma").item())

weight = pyro.param("mean_weight_param").item()
bias = pyro.param("mean_bias_param").item()
#sigma = pyro.param("sigma_param").item()

y_pred = weight * mass + bias 
resid = brain-y_pred
1-resid.var()/d['brain'].var()
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-16-c82e8977fef2> in <module>
----> 1 print("weight = ", pyro.param("mean_weight_param").item())
      2 print("bias = ", pyro.param("mean_bias_param").item())
      3 #print("sigma = ", pyro.param("sigma").item())
      4 
      5 weight = pyro.param("mean_weight_param").item()

/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/pyro/primitives.py in param(name, *args, **kwargs)
     59     """
     60     kwargs["name"] = name
---> 61     return _param(name, *args, **kwargs)
     62 
     63 

/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/pyro/poutine/runtime.py in _fn(*args, **kwargs)
    242 
    243         if not am_i_wrapped():
--> 244             return fn(*args, **kwargs)
    245         else:
    246             msg = {

/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/pyro/params/param_store.py in get_param(self, name, init_tensor, constraint, event_dim)
    201         """
    202         if init_tensor is None:
--> 203             return self[name]
    204         else:
    205             return self.setdefault(name, init_tensor, constraint)

/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/pyro/params/param_store.py in __getitem__(self, name)
     99         Get the constrained value of a named parameter.
    100         """
--> 101         unconstrained_value = self._params[name]
    102 
    103         # compute the constrained value

KeyError: 'mean_weight_param'
import statsmodels.api as sm
import statsmodels.formula.api as smf
mod = smf.ols(formula='brain ~ mass', data=d)
res = mod.fit()

print(res.summary())
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  brain   R-squared:                       0.490
Model:                            OLS   Adj. R-squared:                  0.388
Method:                 Least Squares   F-statistic:                     4.807
Date:                Sun, 05 Jul 2020   Prob (F-statistic):             0.0798
Time:                        16:19:05   Log-Likelihood:                -47.462
No. Observations:                   7   AIC:                             98.92
Df Residuals:                       5   BIC:                             98.82
Df Model:                           1                                         
Covariance Type:            nonrobust                                         
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
Intercept   -227.6287    439.794     -0.518      0.627   -1358.154     902.897
mass          20.6889      9.436      2.192      0.080      -3.568      44.946
==============================================================================
Omnibus:                          nan   Durbin-Watson:                   1.561
Prob(Omnibus):                    nan   Jarque-Bera (JB):                2.372
Skew:                           1.399   Prob(JB):                        0.305
Kurtosis:                       3.548   Cond. No.                         215.
==============================================================================

Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.