Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
freesinger committed Mar 18, 2019
1 parent e615b83 commit e628b39
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions chapter2/2.1.1.pytorch-basics-tensor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@
}
],
"source": [
"# 使用[0,1]均匀分布随机初始化二维数组\n",
"# 使用[0,1]正态分布随机初始化二维数组\n",
"rnd = torch.rand(5, 3)\n",
"rnd"
]
Expand Down Expand Up @@ -871,9 +871,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "pytorch 1.0",
"display_name": "Python 3",
"language": "python",
"name": "pytorch1"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -885,7 +885,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.6.7"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions chapter2/2.1.2-pytorch-basics-autograd.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"在张量创建时,通过设置 requires_grad 标识为Ture来告诉Pytorch需要对该张量进行自动的求导,PyTorch回记录该张量的每一步操作历史并自动计算"
"在张量创建时,通过设置 requires_grad 标识为Ture来告诉Pytorch需要对该张量进行自动的求导,PyTorch会记录该张量的每一步操作历史并自动计算"
]
},
{
Expand Down Expand Up @@ -249,9 +249,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Pytorch for Deeplearning",
"display_name": "Python 3",
"language": "python",
"name": "pytorch"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
6 changes: 3 additions & 3 deletions chapter2/2.1.3-pytorch-basics-nerual-network.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "pytorch 1.0",
"display_name": "Python 3",
"language": "python",
"name": "pytorch1"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -415,7 +415,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.6.7"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions chapter2/2.1.4-pytorch-basics-data-lorder.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Pytorch for Deeplearning",
"display_name": "Python 3",
"language": "python",
"name": "pytorch"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
12 changes: 6 additions & 6 deletions chapter2/2.2-deep-learning-basic-mathematics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"优化器我们选择最长见的优化方法 SGD,就是每一次迭代计算mini-batch的梯度,然后对参数进行更新,学习率0.01 ,优化器本章后面也会进行介绍"
"优化器我们选择最常见的优化方法 SGD,就是每一次迭代计算mini-batch的梯度,然后对参数进行更新,学习率0.01 ,优化器本章后面也会进行介绍"
]
},
{
Expand Down Expand Up @@ -330,9 +330,9 @@
" optim.zero_grad()\n",
" # 计算损失\n",
" loss = criterion(outputs, labels)\n",
" # 反响传播\n",
" # 反向传播\n",
" loss.backward()\n",
" # 使用优化器默认方行优化\n",
" # 使用优化器默认方法优化\n",
" optim.step()\n",
" if (i%100==0):\n",
" #每 100次打印一下损失函数,看看效果\n",
Expand Down Expand Up @@ -391,7 +391,7 @@
}
],
"source": [
"predicted =model.forward(torch.from_numpy(x_train)).data.numpy()\n",
"predicted = model.forward(torch.from_numpy(x_train)).data.numpy()\n",
"plt.plot(x_train, y_train, 'go', label = 'data', alpha = 0.3)\n",
"plt.plot(x_train, predicted, label = 'predicted', alpha = 1)\n",
"plt.legend()\n",
Expand Down Expand Up @@ -676,9 +676,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "pytorch 1.0",
"display_name": "Python 3",
"language": "python",
"name": "pytorch1"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down

0 comments on commit e628b39

Please sign in to comment.