├── 01_intro.ipynb ├── 02_production.ipynb ├── 03_ethics.ipynb ├── 04_mnist_basics.ipynb ├── 05_pet_breeds.ipynb ├── 06_multicat.ipynb ├── 07_sizing_and_tta.ipynb ├── 08_collab.ipynb ├── 09_collab.ipynb ├── 09_tabular.ipynb ├── 10_nlp.ipynb ├── 10_tabular.ipynb ├── 11_nlp.ipynb ├── 11_nlp_dive.ipynb ├── 12_better_rnn.ipynb ├── 12_nlp_dive.ipynb ├── 13_better_rnn.ipynb ├── 13_convolutions.ipynb ├── 14_convolutions.ipynb ├── 14_deep_conv.ipynb ├── 15_deep_conv.ipynb ├── 15_resnet.ipynb ├── 16_arch_details.ipynb ├── 16_resnet.ipynb ├── 17_accel_sgd.ipynb ├── 17_arch_details.ipynb ├── 18_accel_sgd.ipynb ├── 18_callbacks.ipynb ├── 19_callbacks.ipynb ├── 19_foundations.ipynb ├── 20_foundations.ipynb ├── 20_trainingloop.ipynb ├── 21_CAM.ipynb ├── 21_trainingloop.ipynb ├── 22_CAM.ipynb ├── 22_conclusion.ipynb ├── 23_conclusion.ipynb ├── README.md ├── app_blog.ipynb ├── app_jupyter.ipynb ├── images ├── 0_jupyter.png ├── Dropout.png ├── Dropout1.png ├── LSTM.png ├── analytics_chain.gif ├── att_00000.png ├── att_00001.png ├── att_00002.png ├── att_00003.png ├── att_00004.png ├── att_00005.png ├── att_00006.png ├── att_00007.png ├── att_00008.png ├── att_00009.png ├── att_00010.png ├── att_00011.png ├── att_00012.png ├── att_00013.png ├── att_00014.png ├── att_00015.png ├── att_00016.png ├── att_00017.png ├── att_00018.png ├── att_00019.png ├── att_00020.png ├── att_00021.png ├── att_00022.png ├── att_00023.png ├── att_00024.png ├── att_00025.png ├── att_00026.png ├── att_00027.png ├── att_00028.png ├── att_00029.png ├── att_00030.png ├── att_00031.png ├── att_00032.png ├── att_00033.png ├── att_00034.png ├── att_00035.png ├── att_00036.png ├── att_00037.png ├── att_00038.png ├── att_00039.png ├── att_00040.png ├── att_00041.png ├── att_00042.png ├── att_00043.png ├── att_00044.png ├── att_00045.png ├── att_00046.png ├── att_00047.png ├── att_00048.png ├── att_00049.png ├── att_00050.png ├── att_00051.png ├── att_00052.png ├── att_00053.png ├── att_00054.png ├── att_00055.png ├── att_00056.png ├── att_00057.png ├── att_00058.png ├── att_00059.png ├── att_00060.png ├── att_00061.png ├── att_00062.png ├── att_00063.png ├── att_00064.png ├── att_00065.png ├── att_00066.png ├── att_00067.png ├── att_00068.png ├── att_00069.png ├── att_00070.png ├── att_00071.png ├── chapter1_add.png ├── chapter1_busy.png ├── chapter1_cat_example.jpg ├── chapter1_markdown.png ├── chapter1_new_notebook.png ├── chapter1_run.png ├── chapter1_save.png ├── chapter1_terminal.png ├── chapter2_bouncing.PNG ├── chapter2_bouncy.svg ├── chapter2_derivative.PNG ├── chapter2_div.svg ├── chapter2_layer1and2.PNG ├── chapter2_layer3.PNG ├── chapter2_layer4and5.PNG ├── chapter2_perfect.svg ├── chapter2_sgd.PNG ├── chapter2_small.svg ├── chapter4_1cycle_schedule.png ├── chapter4_overfit.png ├── chapter7_neuron.png ├── chapter9_baseconv.svg ├── chapter9_bottleneck.png ├── chapter9_cat_conv.png ├── chapter9_conv_basic.png ├── chapter9_conv_pad.png ├── chapter9_conv_rgb.png ├── chapter9_conv_stride.png ├── chapter9_loss_landscape.png ├── chapter9_nopadconv.svg ├── chapter9_padconv.svg ├── chapter9_rgb_conv_stack.svg ├── chapter9_rgbconv.svg ├── chapter9_skip_connection.png ├── chapter9_strideconv.svg ├── colorful_dist.jpeg ├── colorful_summ.png ├── cover.png ├── driver_phone.png ├── driver_phone2.png ├── drivetrain-approach.png ├── ethics │ ├── image1.png │ ├── image10.png │ ├── image11.png │ ├── image12.png │ ├── image13.png │ ├── image14.png │ ├── image15.jpeg │ ├── image16.png │ ├── image17.jpeg │ ├── image17.png │ ├── image18.jpeg │ ├── image2.png │ ├── image3.jpeg │ ├── image4.png │ ├── image5.png │ ├── image6.png │ ├── image7.png │ ├── image8.png │ └── image9.jpeg ├── fast_template │ ├── image1.png │ ├── image10.png │ ├── image11.png │ ├── image12.png │ ├── image13.png │ ├── image14.png │ ├── image15.png │ ├── image16.png │ ├── image2.png │ ├── image3.png │ ├── image4.png │ ├── image5.png │ ├── image6.png │ ├── image7.png │ ├── image8.png │ └── image9.png ├── fltscale.svg ├── gitblog │ ├── commit.png │ ├── image1.png │ ├── image2.png │ ├── image3.png │ ├── image4.png │ └── image5.png ├── grad_illustration.svg ├── grizzly.jpg ├── healthy_skin.gif ├── matmul2.svg ├── mnist3_xl.gif ├── mnist3_xl_300.gif ├── mnist3_xl_custom.gif ├── pratchett.png ├── profit_drivers.gif ├── sklearn_features.png ├── tarsier.png ├── timeseries1.png ├── timeseries2.png ├── timeseries3.png ├── turing.jpg └── turing_300.jpg └── utils.py /03_ethics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Data Ethics" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## Acknowledgement: Dr Rachel Thomas" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "## Introduction to data ethics" 22 | ] 23 | }, 24 | { 25 | "cell_type": "markdown", 26 | "metadata": {}, 27 | "source": [ 28 | "## Getting started with some examples" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "metadata": {}, 34 | "source": [ 35 | "### Bugs and recourse: Buggy algorithm used for healthcare benefits" 36 | ] 37 | }, 38 | { 39 | "cell_type": "markdown", 40 | "metadata": {}, 41 | "source": [ 42 | "### Feedback loops: YouTube's recommendation system" 43 | ] 44 | }, 45 | { 46 | "cell_type": "markdown", 47 | "metadata": {}, 48 | "source": [ 49 | "### Bias: Professor Lantanya Sweeney \"arrested\"" 50 | ] 51 | }, 52 | { 53 | "cell_type": "markdown", 54 | "metadata": {}, 55 | "source": [ 56 | "## So what?" 57 | ] 58 | }, 59 | { 60 | "cell_type": "markdown", 61 | "metadata": {}, 62 | "source": [ 63 | "## Integrating machine learning with product design" 64 | ] 65 | }, 66 | { 67 | "cell_type": "markdown", 68 | "metadata": {}, 69 | "source": [ 70 | "## Topics in Data Ethics" 71 | ] 72 | }, 73 | { 74 | "cell_type": "markdown", 75 | "metadata": {}, 76 | "source": [ 77 | "## Errors and recourse" 78 | ] 79 | }, 80 | { 81 | "cell_type": "markdown", 82 | "metadata": {}, 83 | "source": [ 84 | "## Feedback loops" 85 | ] 86 | }, 87 | { 88 | "cell_type": "markdown", 89 | "metadata": {}, 90 | "source": [ 91 | "### Bias" 92 | ] 93 | }, 94 | { 95 | "cell_type": "markdown", 96 | "metadata": {}, 97 | "source": [ 98 | "#### Historical bias" 99 | ] 100 | }, 101 | { 102 | "cell_type": "markdown", 103 | "metadata": {}, 104 | "source": [ 105 | "#### Measurement bias" 106 | ] 107 | }, 108 | { 109 | "cell_type": "markdown", 110 | "metadata": {}, 111 | "source": [ 112 | "#### Aggregation Bias" 113 | ] 114 | }, 115 | { 116 | "cell_type": "markdown", 117 | "metadata": {}, 118 | "source": [ 119 | "#### Representation Bias" 120 | ] 121 | }, 122 | { 123 | "cell_type": "markdown", 124 | "metadata": {}, 125 | "source": [ 126 | "### Addressing different types of bias" 127 | ] 128 | }, 129 | { 130 | "cell_type": "markdown", 131 | "metadata": {}, 132 | "source": [ 133 | "### Humans are biased, so does algorithmic bias matter?" 134 | ] 135 | }, 136 | { 137 | "cell_type": "markdown", 138 | "metadata": {}, 139 | "source": [ 140 | "### Data contains errors" 141 | ] 142 | }, 143 | { 144 | "cell_type": "markdown", 145 | "metadata": {}, 146 | "source": [ 147 | "## Disinformation" 148 | ] 149 | }, 150 | { 151 | "cell_type": "markdown", 152 | "metadata": {}, 153 | "source": [ 154 | "## What to do" 155 | ] 156 | }, 157 | { 158 | "cell_type": "markdown", 159 | "metadata": {}, 160 | "source": [ 161 | "### Analyze a project you are working on" 162 | ] 163 | }, 164 | { 165 | "cell_type": "markdown", 166 | "metadata": {}, 167 | "source": [ 168 | "### Processes to implement" 169 | ] 170 | }, 171 | { 172 | "cell_type": "markdown", 173 | "metadata": {}, 174 | "source": [ 175 | "#### Ethical Lenses" 176 | ] 177 | }, 178 | { 179 | "cell_type": "markdown", 180 | "metadata": {}, 181 | "source": [ 182 | "### Fairness, accountability, and transparency" 183 | ] 184 | }, 185 | { 186 | "cell_type": "markdown", 187 | "metadata": {}, 188 | "source": [ 189 | "### Role of Policy" 190 | ] 191 | }, 192 | { 193 | "cell_type": "markdown", 194 | "metadata": {}, 195 | "source": [ 196 | "### The power of diversity" 197 | ] 198 | }, 199 | { 200 | "cell_type": "markdown", 201 | "metadata": {}, 202 | "source": [ 203 | "### Conclusion" 204 | ] 205 | }, 206 | { 207 | "cell_type": "markdown", 208 | "metadata": {}, 209 | "source": [ 210 | "## Questionnaire" 211 | ] 212 | }, 213 | { 214 | "cell_type": "markdown", 215 | "metadata": {}, 216 | "source": [ 217 | "### Further research:" 218 | ] 219 | }, 220 | { 221 | "cell_type": "markdown", 222 | "metadata": {}, 223 | "source": [ 224 | "## Section 1: that's a wrap!" 225 | ] 226 | }, 227 | { 228 | "cell_type": "code", 229 | "execution_count": null, 230 | "metadata": {}, 231 | "outputs": [], 232 | "source": [] 233 | } 234 | ], 235 | "metadata": { 236 | "jupytext": { 237 | "split_at_heading": true 238 | }, 239 | "kernelspec": { 240 | "display_name": "Python 3", 241 | "language": "python", 242 | "name": "python3" 243 | }, 244 | "language_info": { 245 | "codemirror_mode": { 246 | "name": "ipython", 247 | "version": 3 248 | }, 249 | "file_extension": ".py", 250 | "mimetype": "text/x-python", 251 | "name": "python", 252 | "nbconvert_exporter": "python", 253 | "pygments_lexer": "ipython3", 254 | "version": "3.7.4" 255 | } 256 | }, 257 | "nbformat": 4, 258 | "nbformat_minor": 2 259 | } 260 | -------------------------------------------------------------------------------- /13_better_rnn.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "#hide\n", 10 | "from utils import *" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "# Making our RNN state of the art" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 2, 23 | "metadata": {}, 24 | "outputs": [], 25 | "source": [ 26 | "#hide\n", 27 | "from fastai2.text.all import *\n", 28 | "path = untar_data(URLs.HUMAN_NUMBERS)\n", 29 | "lines = L()\n", 30 | "with open(path/'train.txt') as f: lines += L(*f.readlines())\n", 31 | "with open(path/'valid.txt') as f: lines += L(*f.readlines())\n", 32 | "text = ' . '.join([l.strip() for l in lines])\n", 33 | "tokens = text.split(' ')\n", 34 | "vocab = L(*tokens).unique()\n", 35 | "word2idx = {w:i for i,w in enumerate(vocab)}\n", 36 | "nums = L(word2idx[i] for i in tokens)\n", 37 | "\n", 38 | "def group_chunks(ds, bs):\n", 39 | " m = len(ds) // bs\n", 40 | " new_ds = L()\n", 41 | " for i in range(m): new_ds += L(ds[i + m*j] for j in range(bs))\n", 42 | " return new_ds" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": 3, 48 | "metadata": {}, 49 | "outputs": [], 50 | "source": [ 51 | "sl,bs = 16,64\n", 52 | "seqs = L((tensor(nums[i:i+sl]), tensor(nums[i+1:i+sl+1])) for i in range(0,len(nums)-sl-1,sl))\n", 53 | "cut = int(len(seqs) * 0.8)\n", 54 | "dls = DataLoaders.from_dsets(group_chunks(seqs[:cut], bs), group_chunks(seqs[cut:], bs), bs=bs, drop_last=True, shuffle=False)" 55 | ] 56 | }, 57 | { 58 | "cell_type": "markdown", 59 | "metadata": {}, 60 | "source": [ 61 | "## Multilayer RNNs" 62 | ] 63 | }, 64 | { 65 | "cell_type": "markdown", 66 | "metadata": {}, 67 | "source": [ 68 | "### The model" 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": null, 74 | "metadata": {}, 75 | "outputs": [], 76 | "source": [ 77 | "class LMModel5(Module):\n", 78 | " def __init__(self, vocab_sz, n_hidden, n_layers):\n", 79 | " self.i_h = nn.Embedding(vocab_sz, n_hidden)\n", 80 | " self.rnn = nn.RNN(n_hidden, n_hidden, n_layers, batch_first=True)\n", 81 | " self.h_o = nn.Linear(n_hidden, vocab_sz)\n", 82 | " self.h = torch.zeros(n_layers, bs, n_hidden)\n", 83 | " \n", 84 | " def forward(self, x):\n", 85 | " res,h = self.rnn(self.i_h(x), self.h)\n", 86 | " self.h = h.detach()\n", 87 | " return self.h_o(res)\n", 88 | " \n", 89 | " def reset(self): self.h.zero_()" 90 | ] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "execution_count": null, 95 | "metadata": {}, 96 | "outputs": [ 97 | { 98 | "data": { 99 | "text/html": [ 100 | "\n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | "
epochtrain_lossvalid_lossaccuracytime
03.0481152.6223840.43400100:02
12.1363881.7639670.47119100:02
21.6892461.8987180.36474600:02
31.4435451.7474400.48038700:01
41.2710231.8709390.47998000:02
51.1012591.7944280.49536100:02
60.9483801.7696440.51114900:02
70.8223731.8004060.53540000:01
80.7311881.9140650.52246100:01
90.6626591.9875470.52579800:02
100.6130532.0221020.52775100:02
110.5770072.0684720.52653000:02
120.5511442.1135330.52156600:02
130.5353562.1230890.52360000:02
140.5267832.1224130.52433300:02
" 218 | ], 219 | "text/plain": [ 220 | "" 221 | ] 222 | }, 223 | "metadata": {}, 224 | "output_type": "display_data" 225 | } 226 | ], 227 | "source": [ 228 | "learn = Learner(dls, LMModel5(len(vocab), 64, 2), loss_func=CrossEntropyLossFlat(), metrics=accuracy, cbs=ModelReseter)\n", 229 | "learn.fit_one_cycle(15, 3e-3)" 230 | ] 231 | }, 232 | { 233 | "cell_type": "markdown", 234 | "metadata": {}, 235 | "source": [ 236 | "### Handling exploding or disappearing activations" 237 | ] 238 | }, 239 | { 240 | "cell_type": "markdown", 241 | "metadata": {}, 242 | "source": [ 243 | "## LSTM" 244 | ] 245 | }, 246 | { 247 | "cell_type": "markdown", 248 | "metadata": {}, 249 | "source": [ 250 | "### Building an LSTM from scratch" 251 | ] 252 | }, 253 | { 254 | "cell_type": "code", 255 | "execution_count": null, 256 | "metadata": {}, 257 | "outputs": [], 258 | "source": [ 259 | "class LSTMCell(Module):\n", 260 | " def __init__(self, ni, nh):\n", 261 | " self.forget_gate = nn.Linear(ni + nh, nh)\n", 262 | " self.input_gate = nn.Linear(ni + nh, nh)\n", 263 | " self.cell_gate = nn.Linear(ni + nh, nh)\n", 264 | " self.output_gate = nn.Linear(ni + nh, nh)\n", 265 | "\n", 266 | " def forward(self, input, state):\n", 267 | " h,c = state\n", 268 | " h = torch.stack([x, input], dim=1)\n", 269 | " forget = torch.sigmoid(self.forget_gate(h))\n", 270 | " c = c * forget\n", 271 | " inp = torch.sigmoid(self.input_gate(h))\n", 272 | " cell = torch.tanh(self.cell_gate(h))\n", 273 | " c = c + inp * cell\n", 274 | " out = torch.sigmoid(self.output_gate(h))\n", 275 | " h = outgate * torch.tanh(c)\n", 276 | " return h, (h,c)" 277 | ] 278 | }, 279 | { 280 | "cell_type": "code", 281 | "execution_count": null, 282 | "metadata": {}, 283 | "outputs": [], 284 | "source": [ 285 | "class LSTMCell(Module):\n", 286 | " def __init__(self, ni, nh):\n", 287 | " self.ih = nn.Linear(ni,4*nh)\n", 288 | " self.hh = nn.Linear(nh,4*nh)\n", 289 | "\n", 290 | " def forward(self, input, state):\n", 291 | " h,c = state\n", 292 | " #One big multiplication for all the gates is better than 4 smaller ones\n", 293 | " gates = (self.ih(input) + self.hh(h)).chunk(4, 1)\n", 294 | " ingate,forgetgate,outgate = map(torch.sigmoid, gates[:3])\n", 295 | " cellgate = gates[3].tanh()\n", 296 | "\n", 297 | " c = (forgetgate*c) + (ingate*cellgate)\n", 298 | " h = outgate * c.tanh()\n", 299 | " return h, (h,c)" 300 | ] 301 | }, 302 | { 303 | "cell_type": "markdown", 304 | "metadata": {}, 305 | "source": [ 306 | "### Training a language model using LSTMs" 307 | ] 308 | }, 309 | { 310 | "cell_type": "code", 311 | "execution_count": null, 312 | "metadata": {}, 313 | "outputs": [], 314 | "source": [ 315 | "class LMModel6(Module):\n", 316 | " def __init__(self, vocab_sz, n_hidden, n_layers):\n", 317 | " self.i_h = nn.Embedding(vocab_sz, n_hidden)\n", 318 | " self.rnn = nn.LSTM(n_hidden, n_hidden, n_layers, batch_first=True)\n", 319 | " self.h_o = nn.Linear(n_hidden, vocab_sz)\n", 320 | " self.h = [torch.zeros(2, bs, n_hidden) for _ in range(n_layers)]\n", 321 | " \n", 322 | " def forward(self, x):\n", 323 | " res,h = self.rnn(self.i_h(x), self.h)\n", 324 | " self.h = [h_.detach() for h_ in h]\n", 325 | " return self.h_o(res)\n", 326 | " \n", 327 | " def reset(self): \n", 328 | " for h in self.h: h.zero_()" 329 | ] 330 | }, 331 | { 332 | "cell_type": "code", 333 | "execution_count": null, 334 | "metadata": {}, 335 | "outputs": [ 336 | { 337 | "data": { 338 | "text/html": [ 339 | "\n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | " \n", 372 | " \n", 373 | " \n", 374 | " \n", 375 | " \n", 376 | " \n", 377 | " \n", 378 | " \n", 379 | " \n", 380 | " \n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | " \n", 440 | " \n", 441 | " \n", 442 | " \n", 443 | " \n", 444 | " \n", 445 | " \n", 446 | " \n", 447 | " \n", 448 | " \n", 449 | " \n", 450 | " \n", 451 | " \n", 452 | " \n", 453 | " \n", 454 | " \n", 455 | " \n", 456 | "
epochtrain_lossvalid_lossaccuracytime
03.0313462.7493810.27921500:03
12.2196512.0844500.20475300:03
21.6595181.6856390.47957400:03
31.4105501.6666630.50944000:03
41.2040621.6064850.54182900:03
51.0214591.5291090.59244800:03
60.7858711.3402800.64200800:03
70.5475191.2717100.68880200:03
80.3397751.2166050.75382500:03
90.1975501.2185570.74365200:02
100.1142971.2535710.75113900:03
110.0713011.3148270.75268600:03
120.0495071.3073750.76546200:03
130.0388101.2877790.76774100:03
140.0337381.2929510.76798500:03
" 457 | ], 458 | "text/plain": [ 459 | "" 460 | ] 461 | }, 462 | "metadata": {}, 463 | "output_type": "display_data" 464 | } 465 | ], 466 | "source": [ 467 | "learn = Learner(dls, LMModel6(len(vocab), 64, 2), loss_func=CrossEntropyLossFlat(), metrics=accuracy, cbs=ModelReseter)\n", 468 | "learn.fit_one_cycle(15, 1e-2)" 469 | ] 470 | }, 471 | { 472 | "cell_type": "markdown", 473 | "metadata": {}, 474 | "source": [ 475 | "## Regularizing an LSTM" 476 | ] 477 | }, 478 | { 479 | "cell_type": "markdown", 480 | "metadata": {}, 481 | "source": [ 482 | "### Dropout" 483 | ] 484 | }, 485 | { 486 | "cell_type": "code", 487 | "execution_count": null, 488 | "metadata": {}, 489 | "outputs": [], 490 | "source": [ 491 | "class Dropout(Module):\n", 492 | " def __init__(self, p): self.p = p\n", 493 | " def forward(self, x):\n", 494 | " if self.training: return x\n", 495 | " mask = x.new(*x.shape).bernoulli_(1-p)\n", 496 | " return x * mask.div_(1-p)" 497 | ] 498 | }, 499 | { 500 | "cell_type": "markdown", 501 | "metadata": {}, 502 | "source": [ 503 | "### AR and TAR regularization" 504 | ] 505 | }, 506 | { 507 | "cell_type": "markdown", 508 | "metadata": {}, 509 | "source": [ 510 | "### Training a regularized LSTM" 511 | ] 512 | }, 513 | { 514 | "cell_type": "code", 515 | "execution_count": 12, 516 | "metadata": {}, 517 | "outputs": [], 518 | "source": [ 519 | "class LMModel7(Module):\n", 520 | " def __init__(self, vocab_sz, n_hidden, n_layers, p):\n", 521 | " self.i_h = nn.Embedding(vocab_sz, n_hidden)\n", 522 | " self.rnn = nn.LSTM(n_hidden, n_hidden, n_layers, batch_first=True)\n", 523 | " self.drop = nn.Dropout(p)\n", 524 | " self.h_o = nn.Linear(n_hidden, vocab_sz)\n", 525 | " self.h = [torch.zeros(2, bs, n_hidden) for _ in range(n_layers)]\n", 526 | " \n", 527 | " def forward(self, x):\n", 528 | " raw,h = self.rnn(self.i_h(x), self.h)\n", 529 | " out = self.drop(raw)\n", 530 | " self.h = [h_.detach() for h_ in h]\n", 531 | " return self.h_o(out),raw,out\n", 532 | " \n", 533 | " def reset(self): \n", 534 | " for h in self.h: h.zero_()" 535 | ] 536 | }, 537 | { 538 | "cell_type": "code", 539 | "execution_count": 15, 540 | "metadata": {}, 541 | "outputs": [], 542 | "source": [ 543 | "learn = Learner(dls, LMModel7(len(vocab), 64, 2, 0.4), loss_func=CrossEntropyLossFlat(), \n", 544 | " metrics=accuracy, cbs=[ModelReseter, RNNRegularizer(alpha=2, beta=1)])" 545 | ] 546 | }, 547 | { 548 | "cell_type": "code", 549 | "execution_count": 14, 550 | "metadata": {}, 551 | "outputs": [ 552 | { 553 | "data": { 554 | "text/html": [ 555 | "\n", 556 | " \n", 557 | " \n", 558 | " \n", 559 | " \n", 560 | " \n", 561 | " \n", 562 | " \n", 563 | " \n", 564 | " \n", 565 | " \n", 566 | " \n", 567 | " \n", 568 | " \n", 569 | " \n", 570 | " \n", 571 | " \n", 572 | " \n", 573 | " \n", 574 | " \n", 575 | " \n", 576 | " \n", 577 | " \n", 578 | " \n", 579 | " \n", 580 | " \n", 581 | " \n", 582 | " \n", 583 | " \n", 584 | " \n", 585 | " \n", 586 | " \n", 587 | " \n", 588 | " \n", 589 | " \n", 590 | " \n", 591 | " \n", 592 | " \n", 593 | " \n", 594 | " \n", 595 | " \n", 596 | " \n", 597 | " \n", 598 | " \n", 599 | " \n", 600 | " \n", 601 | " \n", 602 | " \n", 603 | " \n", 604 | " \n", 605 | " \n", 606 | " \n", 607 | " \n", 608 | " \n", 609 | " \n", 610 | " \n", 611 | " \n", 612 | " \n", 613 | " \n", 614 | " \n", 615 | " \n", 616 | " \n", 617 | " \n", 618 | " \n", 619 | " \n", 620 | " \n", 621 | " \n", 622 | " \n", 623 | " \n", 624 | " \n", 625 | " \n", 626 | " \n", 627 | " \n", 628 | " \n", 629 | " \n", 630 | " \n", 631 | " \n", 632 | " \n", 633 | " \n", 634 | " \n", 635 | " \n", 636 | " \n", 637 | " \n", 638 | " \n", 639 | " \n", 640 | " \n", 641 | " \n", 642 | " \n", 643 | " \n", 644 | " \n", 645 | " \n", 646 | " \n", 647 | " \n", 648 | " \n", 649 | " \n", 650 | " \n", 651 | " \n", 652 | " \n", 653 | " \n", 654 | " \n", 655 | " \n", 656 | " \n", 657 | " \n", 658 | " \n", 659 | " \n", 660 | " \n", 661 | " \n", 662 | " \n", 663 | " \n", 664 | " \n", 665 | " \n", 666 | " \n", 667 | " \n", 668 | " \n", 669 | " \n", 670 | " \n", 671 | " \n", 672 | "
epochtrain_lossvalid_lossaccuracytime
03.1455532.4959940.43758100:03
12.3331891.6744630.49186200:03
21.6787531.5005360.55395500:03
31.1119041.0401090.74877900:03
40.7078290.7733690.80769900:02
50.4658990.6211590.82934600:03
60.3352490.6499260.83919300:03
70.2544180.5869890.84106400:03
80.2051910.5272880.85017900:02
90.1728760.4600110.86865200:02
100.1514520.5006040.86067700:03
110.1368720.4803420.86352500:03
120.1275760.4965340.85839800:03
130.1221870.4759310.86702500:03
140.1195380.4903660.86116500:03
" 673 | ], 674 | "text/plain": [ 675 | "" 676 | ] 677 | }, 678 | "metadata": {}, 679 | "output_type": "display_data" 680 | } 681 | ], 682 | "source": [ 683 | "learn = TextLearner(dls, LMModel7(len(vocab), 64, 2, 0.4), loss_func=CrossEntropyLossFlat(), \n", 684 | " metrics=accuracy)\n", 685 | "learn.fit_one_cycle(15, 1e-2)" 686 | ] 687 | }, 688 | { 689 | "cell_type": "markdown", 690 | "metadata": {}, 691 | "source": [ 692 | "## Conclusion" 693 | ] 694 | }, 695 | { 696 | "cell_type": "code", 697 | "execution_count": null, 698 | "metadata": {}, 699 | "outputs": [], 700 | "source": [] 701 | } 702 | ], 703 | "metadata": { 704 | "jupytext": { 705 | "split_at_heading": true 706 | }, 707 | "kernelspec": { 708 | "display_name": "Python 3", 709 | "language": "python", 710 | "name": "python3" 711 | }, 712 | "language_info": { 713 | "codemirror_mode": { 714 | "name": "ipython", 715 | "version": 3 716 | }, 717 | "file_extension": ".py", 718 | "mimetype": "text/x-python", 719 | "name": "python", 720 | "nbconvert_exporter": "python", 721 | "pygments_lexer": "ipython3", 722 | "version": "3.7.4" 723 | } 724 | }, 725 | "nbformat": 4, 726 | "nbformat_minor": 2 727 | } 728 | -------------------------------------------------------------------------------- /16_arch_details.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "#hide\n", 10 | "from utils import *" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "# Application architectures deep dive" 18 | ] 19 | }, 20 | { 21 | "cell_type": "markdown", 22 | "metadata": {}, 23 | "source": [ 24 | "## Computer vision" 25 | ] 26 | }, 27 | { 28 | "cell_type": "markdown", 29 | "metadata": {}, 30 | "source": [ 31 | "### cnn_learner" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "metadata": {}, 38 | "outputs": [ 39 | { 40 | "data": { 41 | "text/plain": [ 42 | "{'cut': -2,\n", 43 | " 'split': ,\n", 44 | " 'stats': ([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])}" 45 | ] 46 | }, 47 | "execution_count": null, 48 | "metadata": {}, 49 | "output_type": "execute_result" 50 | } 51 | ], 52 | "source": [ 53 | "model_meta[resnet50]" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": null, 59 | "metadata": {}, 60 | "outputs": [ 61 | { 62 | "data": { 63 | "text/plain": [ 64 | "Sequential(\n", 65 | " (0): AdaptiveConcatPool2d(\n", 66 | " (ap): AdaptiveAvgPool2d(output_size=1)\n", 67 | " (mp): AdaptiveMaxPool2d(output_size=1)\n", 68 | " )\n", 69 | " (1): full: False\n", 70 | " (2): BatchNorm1d(20, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", 71 | " (3): Dropout(p=0.25, inplace=False)\n", 72 | " (4): Linear(in_features=20, out_features=512, bias=False)\n", 73 | " (5): ReLU(inplace=True)\n", 74 | " (6): BatchNorm1d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", 75 | " (7): Dropout(p=0.5, inplace=False)\n", 76 | " (8): Linear(in_features=512, out_features=2, bias=False)\n", 77 | ")" 78 | ] 79 | }, 80 | "execution_count": null, 81 | "metadata": {}, 82 | "output_type": "execute_result" 83 | } 84 | ], 85 | "source": [ 86 | "create_head(20,2)" 87 | ] 88 | }, 89 | { 90 | "cell_type": "markdown", 91 | "metadata": {}, 92 | "source": [ 93 | "### unet_learner" 94 | ] 95 | }, 96 | { 97 | "cell_type": "markdown", 98 | "metadata": {}, 99 | "source": [ 100 | "## Natural language processing" 101 | ] 102 | }, 103 | { 104 | "cell_type": "markdown", 105 | "metadata": {}, 106 | "source": [ 107 | "## Tabular" 108 | ] 109 | }, 110 | { 111 | "cell_type": "markdown", 112 | "metadata": {}, 113 | "source": [ 114 | "## Wrapping up architectures" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": null, 120 | "metadata": {}, 121 | "outputs": [], 122 | "source": [] 123 | } 124 | ], 125 | "metadata": { 126 | "jupytext": { 127 | "split_at_heading": true 128 | }, 129 | "kernelspec": { 130 | "display_name": "Python 3", 131 | "language": "python", 132 | "name": "python3" 133 | }, 134 | "language_info": { 135 | "codemirror_mode": { 136 | "name": "ipython", 137 | "version": 3 138 | }, 139 | "file_extension": ".py", 140 | "mimetype": "text/x-python", 141 | "name": "python", 142 | "nbconvert_exporter": "python", 143 | "pygments_lexer": "ipython3", 144 | "version": "3.7.4" 145 | } 146 | }, 147 | "nbformat": 4, 148 | "nbformat_minor": 2 149 | } 150 | -------------------------------------------------------------------------------- /17_arch_details.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "#hide\n", 10 | "from utils import *" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "## Computer vision" 18 | ] 19 | }, 20 | { 21 | "cell_type": "markdown", 22 | "metadata": {}, 23 | "source": [ 24 | "### cnn_learner" 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": null, 30 | "metadata": {}, 31 | "outputs": [ 32 | { 33 | "data": { 34 | "text/plain": [ 35 | "{'cut': -2,\n", 36 | " 'split': ,\n", 37 | " 'stats': ([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])}" 38 | ] 39 | }, 40 | "execution_count": null, 41 | "metadata": {}, 42 | "output_type": "execute_result" 43 | } 44 | ], 45 | "source": [ 46 | "model_meta[resnet50]" 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": null, 52 | "metadata": {}, 53 | "outputs": [ 54 | { 55 | "data": { 56 | "text/plain": [ 57 | "Sequential(\n", 58 | " (0): AdaptiveConcatPool2d(\n", 59 | " (ap): AdaptiveAvgPool2d(output_size=1)\n", 60 | " (mp): AdaptiveMaxPool2d(output_size=1)\n", 61 | " )\n", 62 | " (1): full: False\n", 63 | " (2): BatchNorm1d(20, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", 64 | " (3): Dropout(p=0.25, inplace=False)\n", 65 | " (4): Linear(in_features=20, out_features=512, bias=False)\n", 66 | " (5): ReLU(inplace=True)\n", 67 | " (6): BatchNorm1d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", 68 | " (7): Dropout(p=0.5, inplace=False)\n", 69 | " (8): Linear(in_features=512, out_features=2, bias=False)\n", 70 | ")" 71 | ] 72 | }, 73 | "execution_count": null, 74 | "metadata": {}, 75 | "output_type": "execute_result" 76 | } 77 | ], 78 | "source": [ 79 | "create_head(20,2)" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "### unet_learner" 87 | ] 88 | }, 89 | { 90 | "cell_type": "markdown", 91 | "metadata": {}, 92 | "source": [ 93 | "## Natural language processing" 94 | ] 95 | }, 96 | { 97 | "cell_type": "markdown", 98 | "metadata": {}, 99 | "source": [ 100 | "## Tabular" 101 | ] 102 | }, 103 | { 104 | "cell_type": "markdown", 105 | "metadata": {}, 106 | "source": [ 107 | "## Wrapping up architectures" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": null, 113 | "metadata": {}, 114 | "outputs": [], 115 | "source": [] 116 | } 117 | ], 118 | "metadata": { 119 | "kernelspec": { 120 | "display_name": "Python 3", 121 | "language": "python", 122 | "name": "python3" 123 | } 124 | }, 125 | "nbformat": 4, 126 | "nbformat_minor": 2 127 | } 128 | -------------------------------------------------------------------------------- /18_callbacks.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "#hide\n", 10 | "from utils import *" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "# Callbacks" 18 | ] 19 | }, 20 | { 21 | "cell_type": "markdown", 22 | "metadata": {}, 23 | "source": [ 24 | "## Introduction to callbacks" 25 | ] 26 | }, 27 | { 28 | "cell_type": "markdown", 29 | "metadata": {}, 30 | "source": [ 31 | "## Creating a callback" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "metadata": {}, 38 | "outputs": [], 39 | "source": [ 40 | "class ModelReseter(Callback):\n", 41 | " def begin_train(self): self.model.reset()\n", 42 | " def begin_validate(self): self.model.reset()" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": null, 48 | "metadata": {}, 49 | "outputs": [], 50 | "source": [ 51 | "class RNNRegularizer(Callback):\n", 52 | " def __init__(self, alpha=0., beta=0.): self.alpha,self.beta = alpha,beta\n", 53 | "\n", 54 | " def after_pred(self):\n", 55 | " self.raw_out,self.out = self.pred[1],self.pred[2]\n", 56 | " self.learn.pred = self.pred[0]\n", 57 | "\n", 58 | " def after_loss(self):\n", 59 | " if not self.training: return\n", 60 | " if self.alpha != 0.:\n", 61 | " self.learn.loss += self.alpha * self.out[-1].float().pow(2).mean()\n", 62 | " if self.beta != 0.:\n", 63 | " h = self.raw_out[-1]\n", 64 | " if len(h)>1:\n", 65 | " self.learn.loss += self.beta * (h[:,1:] - h[:,:-1]\n", 66 | " ).float().pow(2).mean()" 67 | ] 68 | }, 69 | { 70 | "cell_type": "markdown", 71 | "metadata": {}, 72 | "source": [ 73 | "## Callback ordering and exceptions" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": null, 79 | "metadata": {}, 80 | "outputs": [], 81 | "source": [ 82 | "class TerminateOnNaNCallback(Callback):\n", 83 | " run_before=Recorder\n", 84 | " def after_batch(self):\n", 85 | " if torch.isinf(self.loss) or torch.isnan(self.loss):\n", 86 | " raise CancelFitException" 87 | ] 88 | }, 89 | { 90 | "cell_type": "markdown", 91 | "metadata": {}, 92 | "source": [ 93 | "## Summary" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": null, 99 | "metadata": {}, 100 | "outputs": [], 101 | "source": [] 102 | } 103 | ], 104 | "metadata": { 105 | "jupytext": { 106 | "split_at_heading": true 107 | }, 108 | "kernelspec": { 109 | "display_name": "Python 3", 110 | "language": "python", 111 | "name": "python3" 112 | }, 113 | "language_info": { 114 | "codemirror_mode": { 115 | "name": "ipython", 116 | "version": 3 117 | }, 118 | "file_extension": ".py", 119 | "mimetype": "text/x-python", 120 | "name": "python", 121 | "nbconvert_exporter": "python", 122 | "pygments_lexer": "ipython3", 123 | "version": "3.7.4" 124 | } 125 | }, 126 | "nbformat": 4, 127 | "nbformat_minor": 2 128 | } 129 | -------------------------------------------------------------------------------- /19_callbacks.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "#hide\n", 10 | "from utils import *" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "# Callbacks" 18 | ] 19 | }, 20 | { 21 | "cell_type": "markdown", 22 | "metadata": {}, 23 | "source": [ 24 | "## Introduction to callbacks" 25 | ] 26 | }, 27 | { 28 | "cell_type": "markdown", 29 | "metadata": {}, 30 | "source": [ 31 | "## Creating a callback" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "metadata": {}, 38 | "outputs": [], 39 | "source": [ 40 | "class ModelReseter(Callback):\n", 41 | " def begin_train(self): self.model.reset()\n", 42 | " def begin_validate(self): self.model.reset()" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": null, 48 | "metadata": {}, 49 | "outputs": [], 50 | "source": [ 51 | "class RNNRegularizer(Callback):\n", 52 | " def __init__(self, alpha=0., beta=0.): self.alpha,self.beta = alpha,beta\n", 53 | "\n", 54 | " def after_pred(self):\n", 55 | " self.raw_out,self.out = self.pred[1],self.pred[2]\n", 56 | " self.learn.pred = self.pred[0]\n", 57 | "\n", 58 | " def after_loss(self):\n", 59 | " if not self.training: return\n", 60 | " if self.alpha != 0.:\n", 61 | " self.learn.loss += self.alpha * self.out[-1].float().pow(2).mean()\n", 62 | " if self.beta != 0.:\n", 63 | " h = self.raw_out[-1]\n", 64 | " if len(h)>1:\n", 65 | " self.learn.loss += self.beta * (h[:,1:] - h[:,:-1]\n", 66 | " ).float().pow(2).mean()" 67 | ] 68 | }, 69 | { 70 | "cell_type": "markdown", 71 | "metadata": {}, 72 | "source": [ 73 | "## Callback ordering and exceptions" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": null, 79 | "metadata": {}, 80 | "outputs": [], 81 | "source": [ 82 | "class TerminateOnNaNCallback(Callback):\n", 83 | " run_before=Recorder\n", 84 | " def after_batch(self):\n", 85 | " if torch.isinf(self.loss) or torch.isnan(self.loss):\n", 86 | " raise CancelFitException" 87 | ] 88 | }, 89 | { 90 | "cell_type": "markdown", 91 | "metadata": {}, 92 | "source": [ 93 | "## Summary" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": null, 99 | "metadata": {}, 100 | "outputs": [], 101 | "source": [] 102 | } 103 | ], 104 | "metadata": { 105 | "kernelspec": { 106 | "display_name": "Python 3", 107 | "language": "python", 108 | "name": "python3" 109 | } 110 | }, 111 | "nbformat": 4, 112 | "nbformat_minor": 2 113 | } 114 | -------------------------------------------------------------------------------- /22_conclusion.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Concluding thoughts" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": null, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [] 16 | } 17 | ], 18 | "metadata": { 19 | "jupytext": { 20 | "split_at_heading": true 21 | }, 22 | "kernelspec": { 23 | "display_name": "Python 3", 24 | "language": "python", 25 | "name": "python3" 26 | }, 27 | "language_info": { 28 | "codemirror_mode": { 29 | "name": "ipython", 30 | "version": 3 31 | }, 32 | "file_extension": ".py", 33 | "mimetype": "text/x-python", 34 | "name": "python", 35 | "nbconvert_exporter": "python", 36 | "pygments_lexer": "ipython3", 37 | "version": "3.7.4" 38 | } 39 | }, 40 | "nbformat": 4, 41 | "nbformat_minor": 2 42 | } 43 | -------------------------------------------------------------------------------- /23_conclusion.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Concluding thoughts" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": null, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [] 16 | } 17 | ], 18 | "metadata": { 19 | "kernelspec": { 20 | "display_name": "Python 3", 21 | "language": "python", 22 | "name": "python3" 23 | } 24 | }, 25 | "nbformat": 4, 26 | "nbformat_minor": 2 27 | } 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # book_nbs 2 | Notebooks for upcoming fastai book (draft / incomplete) 3 | -------------------------------------------------------------------------------- /app_blog.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "#hide\n", 10 | "from utils import *\n", 11 | "from fastai2.vision.widgets import *" 12 | ] 13 | }, 14 | { 15 | "cell_type": "markdown", 16 | "metadata": {}, 17 | "source": [ 18 | "# Creating a blog" 19 | ] 20 | }, 21 | { 22 | "cell_type": "markdown", 23 | "metadata": {}, 24 | "source": [ 25 | "## Blogging with GitHub Pages" 26 | ] 27 | }, 28 | { 29 | "cell_type": "markdown", 30 | "metadata": {}, 31 | "source": [ 32 | "### Creating the repository" 33 | ] 34 | }, 35 | { 36 | "cell_type": "markdown", 37 | "metadata": {}, 38 | "source": [ 39 | "### Setting up your homepage" 40 | ] 41 | }, 42 | { 43 | "cell_type": "markdown", 44 | "metadata": {}, 45 | "source": [ 46 | "### Creating posts" 47 | ] 48 | }, 49 | { 50 | "cell_type": "markdown", 51 | "metadata": {}, 52 | "source": [ 53 | "### Synchronizing GitHub and your computer" 54 | ] 55 | }, 56 | { 57 | "cell_type": "markdown", 58 | "metadata": {}, 59 | "source": [ 60 | "### Jupyter for blogging" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "metadata": {}, 67 | "outputs": [], 68 | "source": [] 69 | } 70 | ], 71 | "metadata": { 72 | "jupytext": { 73 | "split_at_heading": true 74 | }, 75 | "kernelspec": { 76 | "display_name": "Python 3", 77 | "language": "python", 78 | "name": "python3" 79 | } 80 | }, 81 | "nbformat": 4, 82 | "nbformat_minor": 2 83 | } 84 | -------------------------------------------------------------------------------- /images/0_jupyter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/0_jupyter.png -------------------------------------------------------------------------------- /images/Dropout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/Dropout.png -------------------------------------------------------------------------------- /images/Dropout1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/Dropout1.png -------------------------------------------------------------------------------- /images/LSTM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/LSTM.png -------------------------------------------------------------------------------- /images/analytics_chain.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/analytics_chain.gif -------------------------------------------------------------------------------- /images/att_00000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00000.png -------------------------------------------------------------------------------- /images/att_00001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00001.png -------------------------------------------------------------------------------- /images/att_00002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00002.png -------------------------------------------------------------------------------- /images/att_00003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00003.png -------------------------------------------------------------------------------- /images/att_00004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00004.png -------------------------------------------------------------------------------- /images/att_00005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00005.png -------------------------------------------------------------------------------- /images/att_00006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00006.png -------------------------------------------------------------------------------- /images/att_00007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00007.png -------------------------------------------------------------------------------- /images/att_00008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00008.png -------------------------------------------------------------------------------- /images/att_00009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00009.png -------------------------------------------------------------------------------- /images/att_00010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00010.png -------------------------------------------------------------------------------- /images/att_00011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00011.png -------------------------------------------------------------------------------- /images/att_00012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00012.png -------------------------------------------------------------------------------- /images/att_00013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00013.png -------------------------------------------------------------------------------- /images/att_00014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00014.png -------------------------------------------------------------------------------- /images/att_00015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00015.png -------------------------------------------------------------------------------- /images/att_00016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00016.png -------------------------------------------------------------------------------- /images/att_00017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00017.png -------------------------------------------------------------------------------- /images/att_00018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00018.png -------------------------------------------------------------------------------- /images/att_00019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00019.png -------------------------------------------------------------------------------- /images/att_00020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00020.png -------------------------------------------------------------------------------- /images/att_00021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00021.png -------------------------------------------------------------------------------- /images/att_00022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00022.png -------------------------------------------------------------------------------- /images/att_00023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00023.png -------------------------------------------------------------------------------- /images/att_00024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00024.png -------------------------------------------------------------------------------- /images/att_00025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00025.png -------------------------------------------------------------------------------- /images/att_00026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00026.png -------------------------------------------------------------------------------- /images/att_00027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00027.png -------------------------------------------------------------------------------- /images/att_00028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00028.png -------------------------------------------------------------------------------- /images/att_00029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00029.png -------------------------------------------------------------------------------- /images/att_00030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00030.png -------------------------------------------------------------------------------- /images/att_00031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00031.png -------------------------------------------------------------------------------- /images/att_00032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00032.png -------------------------------------------------------------------------------- /images/att_00033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00033.png -------------------------------------------------------------------------------- /images/att_00034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00034.png -------------------------------------------------------------------------------- /images/att_00035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00035.png -------------------------------------------------------------------------------- /images/att_00036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00036.png -------------------------------------------------------------------------------- /images/att_00037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00037.png -------------------------------------------------------------------------------- /images/att_00038.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00038.png -------------------------------------------------------------------------------- /images/att_00039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00039.png -------------------------------------------------------------------------------- /images/att_00040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00040.png -------------------------------------------------------------------------------- /images/att_00041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00041.png -------------------------------------------------------------------------------- /images/att_00042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00042.png -------------------------------------------------------------------------------- /images/att_00043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00043.png -------------------------------------------------------------------------------- /images/att_00044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00044.png -------------------------------------------------------------------------------- /images/att_00045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00045.png -------------------------------------------------------------------------------- /images/att_00046.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00046.png -------------------------------------------------------------------------------- /images/att_00047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00047.png -------------------------------------------------------------------------------- /images/att_00048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00048.png -------------------------------------------------------------------------------- /images/att_00049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00049.png -------------------------------------------------------------------------------- /images/att_00050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00050.png -------------------------------------------------------------------------------- /images/att_00051.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00051.png -------------------------------------------------------------------------------- /images/att_00052.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00052.png -------------------------------------------------------------------------------- /images/att_00053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00053.png -------------------------------------------------------------------------------- /images/att_00054.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00054.png -------------------------------------------------------------------------------- /images/att_00055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00055.png -------------------------------------------------------------------------------- /images/att_00056.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00056.png -------------------------------------------------------------------------------- /images/att_00057.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00057.png -------------------------------------------------------------------------------- /images/att_00058.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00058.png -------------------------------------------------------------------------------- /images/att_00059.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00059.png -------------------------------------------------------------------------------- /images/att_00060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00060.png -------------------------------------------------------------------------------- /images/att_00061.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00061.png -------------------------------------------------------------------------------- /images/att_00062.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00062.png -------------------------------------------------------------------------------- /images/att_00063.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00063.png -------------------------------------------------------------------------------- /images/att_00064.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00064.png -------------------------------------------------------------------------------- /images/att_00065.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00065.png -------------------------------------------------------------------------------- /images/att_00066.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00066.png -------------------------------------------------------------------------------- /images/att_00067.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00067.png -------------------------------------------------------------------------------- /images/att_00068.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00068.png -------------------------------------------------------------------------------- /images/att_00069.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00069.png -------------------------------------------------------------------------------- /images/att_00070.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00070.png -------------------------------------------------------------------------------- /images/att_00071.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/att_00071.png -------------------------------------------------------------------------------- /images/chapter1_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter1_add.png -------------------------------------------------------------------------------- /images/chapter1_busy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter1_busy.png -------------------------------------------------------------------------------- /images/chapter1_cat_example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter1_cat_example.jpg -------------------------------------------------------------------------------- /images/chapter1_markdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter1_markdown.png -------------------------------------------------------------------------------- /images/chapter1_new_notebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter1_new_notebook.png -------------------------------------------------------------------------------- /images/chapter1_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter1_run.png -------------------------------------------------------------------------------- /images/chapter1_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter1_save.png -------------------------------------------------------------------------------- /images/chapter1_terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter1_terminal.png -------------------------------------------------------------------------------- /images/chapter2_bouncing.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter2_bouncing.PNG -------------------------------------------------------------------------------- /images/chapter2_bouncy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /images/chapter2_derivative.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter2_derivative.PNG -------------------------------------------------------------------------------- /images/chapter2_div.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /images/chapter2_layer1and2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter2_layer1and2.PNG -------------------------------------------------------------------------------- /images/chapter2_layer3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter2_layer3.PNG -------------------------------------------------------------------------------- /images/chapter2_layer4and5.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter2_layer4and5.PNG -------------------------------------------------------------------------------- /images/chapter2_perfect.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /images/chapter2_sgd.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter2_sgd.PNG -------------------------------------------------------------------------------- /images/chapter2_small.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /images/chapter4_1cycle_schedule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter4_1cycle_schedule.png -------------------------------------------------------------------------------- /images/chapter4_overfit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter4_overfit.png -------------------------------------------------------------------------------- /images/chapter7_neuron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter7_neuron.png -------------------------------------------------------------------------------- /images/chapter9_bottleneck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter9_bottleneck.png -------------------------------------------------------------------------------- /images/chapter9_cat_conv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter9_cat_conv.png -------------------------------------------------------------------------------- /images/chapter9_conv_basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter9_conv_basic.png -------------------------------------------------------------------------------- /images/chapter9_conv_pad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter9_conv_pad.png -------------------------------------------------------------------------------- /images/chapter9_conv_rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter9_conv_rgb.png -------------------------------------------------------------------------------- /images/chapter9_conv_stride.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter9_conv_stride.png -------------------------------------------------------------------------------- /images/chapter9_loss_landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter9_loss_landscape.png -------------------------------------------------------------------------------- /images/chapter9_nopadconv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /images/chapter9_padconv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /images/chapter9_rgb_conv_stack.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /images/chapter9_rgbconv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /images/chapter9_skip_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/chapter9_skip_connection.png -------------------------------------------------------------------------------- /images/chapter9_strideconv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /images/colorful_dist.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/colorful_dist.jpeg -------------------------------------------------------------------------------- /images/colorful_summ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/colorful_summ.png -------------------------------------------------------------------------------- /images/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/cover.png -------------------------------------------------------------------------------- /images/driver_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/driver_phone.png -------------------------------------------------------------------------------- /images/driver_phone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/driver_phone2.png -------------------------------------------------------------------------------- /images/drivetrain-approach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/drivetrain-approach.png -------------------------------------------------------------------------------- /images/ethics/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image1.png -------------------------------------------------------------------------------- /images/ethics/image10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image10.png -------------------------------------------------------------------------------- /images/ethics/image11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image11.png -------------------------------------------------------------------------------- /images/ethics/image12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image12.png -------------------------------------------------------------------------------- /images/ethics/image13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image13.png -------------------------------------------------------------------------------- /images/ethics/image14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image14.png -------------------------------------------------------------------------------- /images/ethics/image15.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image15.jpeg -------------------------------------------------------------------------------- /images/ethics/image16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image16.png -------------------------------------------------------------------------------- /images/ethics/image17.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image17.jpeg -------------------------------------------------------------------------------- /images/ethics/image17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image17.png -------------------------------------------------------------------------------- /images/ethics/image18.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image18.jpeg -------------------------------------------------------------------------------- /images/ethics/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image2.png -------------------------------------------------------------------------------- /images/ethics/image3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image3.jpeg -------------------------------------------------------------------------------- /images/ethics/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image4.png -------------------------------------------------------------------------------- /images/ethics/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image5.png -------------------------------------------------------------------------------- /images/ethics/image6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image6.png -------------------------------------------------------------------------------- /images/ethics/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image7.png -------------------------------------------------------------------------------- /images/ethics/image8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image8.png -------------------------------------------------------------------------------- /images/ethics/image9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/ethics/image9.jpeg -------------------------------------------------------------------------------- /images/fast_template/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image1.png -------------------------------------------------------------------------------- /images/fast_template/image10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image10.png -------------------------------------------------------------------------------- /images/fast_template/image11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image11.png -------------------------------------------------------------------------------- /images/fast_template/image12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image12.png -------------------------------------------------------------------------------- /images/fast_template/image13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image13.png -------------------------------------------------------------------------------- /images/fast_template/image14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image14.png -------------------------------------------------------------------------------- /images/fast_template/image15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image15.png -------------------------------------------------------------------------------- /images/fast_template/image16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image16.png -------------------------------------------------------------------------------- /images/fast_template/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image2.png -------------------------------------------------------------------------------- /images/fast_template/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image3.png -------------------------------------------------------------------------------- /images/fast_template/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image4.png -------------------------------------------------------------------------------- /images/fast_template/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image5.png -------------------------------------------------------------------------------- /images/fast_template/image6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image6.png -------------------------------------------------------------------------------- /images/fast_template/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image7.png -------------------------------------------------------------------------------- /images/fast_template/image8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image8.png -------------------------------------------------------------------------------- /images/fast_template/image9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/fast_template/image9.png -------------------------------------------------------------------------------- /images/gitblog/commit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/gitblog/commit.png -------------------------------------------------------------------------------- /images/gitblog/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/gitblog/image1.png -------------------------------------------------------------------------------- /images/gitblog/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/gitblog/image2.png -------------------------------------------------------------------------------- /images/gitblog/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/gitblog/image3.png -------------------------------------------------------------------------------- /images/gitblog/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/gitblog/image4.png -------------------------------------------------------------------------------- /images/gitblog/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/gitblog/image5.png -------------------------------------------------------------------------------- /images/grad_illustration.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /images/grizzly.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/grizzly.jpg -------------------------------------------------------------------------------- /images/healthy_skin.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/healthy_skin.gif -------------------------------------------------------------------------------- /images/mnist3_xl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/mnist3_xl.gif -------------------------------------------------------------------------------- /images/mnist3_xl_300.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/mnist3_xl_300.gif -------------------------------------------------------------------------------- /images/mnist3_xl_custom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/mnist3_xl_custom.gif -------------------------------------------------------------------------------- /images/pratchett.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/pratchett.png -------------------------------------------------------------------------------- /images/profit_drivers.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/profit_drivers.gif -------------------------------------------------------------------------------- /images/sklearn_features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/sklearn_features.png -------------------------------------------------------------------------------- /images/tarsier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/tarsier.png -------------------------------------------------------------------------------- /images/timeseries1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/timeseries1.png -------------------------------------------------------------------------------- /images/timeseries2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/timeseries2.png -------------------------------------------------------------------------------- /images/timeseries3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/timeseries3.png -------------------------------------------------------------------------------- /images/turing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/turing.jpg -------------------------------------------------------------------------------- /images/turing_300.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastai/book_nbs/a7548b8d7f81cc04d0a2d035d05497c6833048c1/images/turing_300.jpg -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | # Numpy and pandas by default assume a narrow screen - this fixes that 2 | from fastai2.vision.all import * 3 | from nbdev.showdoc import * 4 | from ipywidgets import widgets 5 | from pandas.api.types import CategoricalDtype 6 | 7 | import matplotlib as mpl 8 | # mpl.rcParams['figure.dpi']= 200 9 | mpl.rcParams['savefig.dpi']= 200 10 | mpl.rcParams['font.size']=12 11 | 12 | set_seed(42) 13 | torch.backends.cudnn.deterministic = True 14 | torch.backends.cudnn.benchmark = False 15 | pd.set_option('display.max_columns',999) 16 | np.set_printoptions(linewidth=200) 17 | torch.set_printoptions(linewidth=200) 18 | 19 | import graphviz 20 | def gv(s): return graphviz.Source('digraph G{ rankdir="LR"' + s + '; }') 21 | 22 | def get_image_files_sorted(path, recurse=True, folders=None): return get_image_files(path, recurse, folders).sorted() 23 | 24 | 25 | # + 26 | # pip install azure-cognitiveservices-search-imagesearch 27 | 28 | from azure.cognitiveservices.search.imagesearch import ImageSearchClient as api 29 | from msrest.authentication import CognitiveServicesCredentials as auth 30 | 31 | def search_images_bing(key, term, min_sz=128): 32 | client = api('https://api.cognitive.microsoft.com', auth(key)) 33 | return L(client.images.search(query=term, count=150, min_height=min_sz, min_width=min_sz).value) 34 | 35 | 36 | # - 37 | 38 | def plot_function(f, tx=None, ty=None, title=None, min=-2, max=2, figsize=(6,4)): 39 | x = torch.linspace(min,max) 40 | fig,ax = plt.subplots(figsize=figsize) 41 | ax.plot(x,f(x)) 42 | if tx is not None: ax.set_xlabel(tx) 43 | if ty is not None: ax.set_ylabel(ty) 44 | if title is not None: ax.set_title(title) 45 | 46 | # + 47 | from sklearn.tree import export_graphviz 48 | 49 | def draw_tree(t, df, size=10, ratio=0.6, precision=0, **kwargs): 50 | s=export_graphviz(t, out_file=None, feature_names=df.columns, filled=True, rounded=True, 51 | special_characters=True, rotate=False, precision=precision, **kwargs) 52 | return graphviz.Source(re.sub('Tree {', f'Tree {{ size={size}; ratio={ratio}', s)) 53 | 54 | 55 | # + 56 | from scipy.cluster import hierarchy as hc 57 | 58 | def cluster_columns(df, figsize=(10,6), font_size=12): 59 | corr = np.round(scipy.stats.spearmanr(df).correlation, 4) 60 | corr_condensed = hc.distance.squareform(1-corr) 61 | z = hc.linkage(corr_condensed, method='average') 62 | fig = plt.figure(figsize=figsize) 63 | hc.dendrogram(z, labels=df.columns, orientation='left', leaf_font_size=font_size) 64 | plt.show() 65 | --------------------------------------------------------------------------------