Skip to content

Commit ef86482

Browse files
committed
update utils
1 parent a699e10 commit ef86482

File tree

12 files changed

+1150
-11
lines changed

12 files changed

+1150
-11
lines changed

chapter4_CNN/batch-normalization.ipynb

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
},
2020
"outputs": [],
2121
"source": [
22+
"import sys\n",
23+
"sys.path.append('..')\n",
24+
"\n",
2225
"import torch"
2326
]
2427
},

chapter4_CNN/data-augumentation.ipynb

+3
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@
409409
},
410410
"outputs": [],
411411
"source": [
412+
"import sys\n",
413+
"sys.path.append('..')\n",
414+
"\n",
412415
"import numpy as np\n",
413416
"import torch\n",
414417
"from torch import nn\n",

chapter4_CNN/densenet.ipynb

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
},
2020
"outputs": [],
2121
"source": [
22+
"import sys\n",
23+
"sys.path.append('..')\n",
24+
"\n",
2225
"import numpy as np\n",
2326
"import torch\n",
2427
"from torch import nn\n",

chapter4_CNN/googlenet.ipynb

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
},
2020
"outputs": [],
2121
"source": [
22+
"import sys\n",
23+
"sys.path.append('..')\n",
24+
"\n",
2225
"import numpy as np\n",
2326
"import torch\n",
2427
"from torch import nn\n",

chapter4_CNN/lr-decay.ipynb

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
},
2020
"outputs": [],
2121
"source": [
22+
"import sys\n",
23+
"sys.path.append('..')\n",
24+
"\n",
2225
"import numpy as np\n",
2326
"import torch\n",
2427
"from torch import nn\n",

chapter4_CNN/regularization.ipynb

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
},
2020
"outputs": [],
2121
"source": [
22+
"import sys\n",
23+
"sys.path.append('..')\n",
24+
"\n",
2225
"import numpy as np\n",
2326
"import torch\n",
2427
"from torch import nn\n",

chapter4_CNN/resnet.ipynb

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
},
2020
"outputs": [],
2121
"source": [
22+
"import sys\n",
23+
"sys.path.append('..')\n",
24+
"\n",
2225
"import numpy as np\n",
2326
"import torch\n",
2427
"from torch import nn\n",

chapter4_CNN/vgg.ipynb

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
},
2020
"outputs": [],
2121
"source": [
22+
"import sys\n",
23+
"sys.path.append('..')\n",
24+
"\n",
2225
"import numpy as np\n",
2326
"import torch\n",
2427
"from torch import nn\n",

chapter6_PyTorch-Advances/optimizer/momentum.ipynb

+1-8
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,6 @@
116116
"print('使用时间: {:.5f} s'.format(end - start))"
117117
]
118118
},
119-
{
120-
"cell_type": "markdown",
121-
"metadata": {},
122-
"source": [
123-
"当然,pytorch 内置了动量法的实现,非常简单,直接在 `torch.optim.SGD(momentum=0.9)` 即可,下面实现一下"
124-
]
125-
},
126119
{
127120
"cell_type": "code",
128121
"execution_count": 25,
@@ -145,7 +138,7 @@
145138
],
146139
"source": [
147140
"train_data = DataLoader(train_set, batch_size=64, shuffle=True)\n",
148-
"# 使用 Sequential 定义 3 层神经网络\n",
141+
"# 使用 Sequential 定义 2 层神经网络\n",
149142
"net = nn.Sequential(\n",
150143
" nn.Linear(784, 200),\n",
151144
" nn.ReLU(),\n",

chapter6_PyTorch-Advances/tensorboard.ipynb

+6-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
},
2121
"outputs": [],
2222
"source": [
23+
"import sys\n",
24+
"sys.path.append('..')\n",
25+
"\n",
2326
"import numpy as np\n",
2427
"import torch\n",
2528
"from torch import nn\n",
@@ -200,9 +203,9 @@
200203
],
201204
"metadata": {
202205
"kernelspec": {
203-
"display_name": "Python 3",
206+
"display_name": "mx",
204207
"language": "python",
205-
"name": "python3"
208+
"name": "mx"
206209
},
207210
"language_info": {
208211
"codemirror_mode": {
@@ -214,7 +217,7 @@
214217
"name": "python",
215218
"nbconvert_exporter": "python",
216219
"pygments_lexer": "ipython3",
217-
"version": "3.6.2"
220+
"version": "3.6.0"
218221
}
219222
},
220223
"nbformat": 4,

chapter7_Computer-Vision/fine-tune.ipynb

+1,119
Large diffs are not rendered by default.
File renamed without changes.

0 commit comments

Comments
 (0)