From 62819e2a3d847c722c8227e4dd4def0432ff3728 Mon Sep 17 00:00:00 2001 From: smilesboy <1563400360@qq.com> Date: Fri, 27 Apr 2018 19:54:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zh/beginner_source/examples_autograd/tf_two_layer_net.py | 4 ++-- .../examples_autograd/two_layer_net_autograd.py | 4 ++-- .../examples_autograd/two_layer_net_custom_function.py | 4 ++-- tutorial/zh/beginner_source/examples_nn/dynamic_net.py | 4 ++-- .../zh/beginner_source/examples_nn/two_layer_net_module.py | 5 ++--- tutorial/zh/beginner_source/examples_nn/two_layer_net_nn.py | 4 ++-- .../zh/beginner_source/examples_nn/two_layer_net_optim.py | 4 ++-- .../beginner_source/examples_tensor/two_layer_net_tensor.py | 4 ++-- 8 files changed, 16 insertions(+), 17 deletions(-) diff --git a/tutorial/zh/beginner_source/examples_autograd/tf_two_layer_net.py b/tutorial/zh/beginner_source/examples_autograd/tf_two_layer_net.py index be69b4d4c..82cc4832e 100644 --- a/tutorial/zh/beginner_source/examples_autograd/tf_two_layer_net.py +++ b/tutorial/zh/beginner_source/examples_autograd/tf_two_layer_net.py @@ -21,8 +21,8 @@ # 首先我们设置计算图: -# N 批量大小; D_in是输入尺寸; -# H是隐藏尺寸; D_out是输出尺寸. +# N 是一个batch的样本数量; D_in是输入维度; +# H 是隐藏层向量的维度; D_out是输出维度. N, D_in, H, D_out = 64, 1000, 100, 10 # 为输入数据和目标数据创建占位符; diff --git a/tutorial/zh/beginner_source/examples_autograd/two_layer_net_autograd.py b/tutorial/zh/beginner_source/examples_autograd/two_layer_net_autograd.py index c8064b535..4b80cbb86 100644 --- a/tutorial/zh/beginner_source/examples_autograd/two_layer_net_autograd.py +++ b/tutorial/zh/beginner_source/examples_autograd/two_layer_net_autograd.py @@ -24,8 +24,8 @@ dtype = torch.FloatTensor # dtype = torch.cuda.FloatTensor # 取消注释以在GPU上运行 -# N 批量大小; D_in是输入尺寸; -# H是隐藏尺寸; D_out是输出尺寸. +# N 是一个batch的样本数量; D_in是输入维度; +# H 是隐藏层向量的维度; D_out是输出维度. N, D_in, H, D_out = 64, 1000, 100, 10 # 创建随机张量来保存输入和输出,并将它们包装在变量中. diff --git a/tutorial/zh/beginner_source/examples_autograd/two_layer_net_custom_function.py b/tutorial/zh/beginner_source/examples_autograd/two_layer_net_custom_function.py index 60bba7e01..def565aa5 100644 --- a/tutorial/zh/beginner_source/examples_autograd/two_layer_net_custom_function.py +++ b/tutorial/zh/beginner_source/examples_autograd/two_layer_net_custom_function.py @@ -47,8 +47,8 @@ def backward(ctx, grad_output): dtype = torch.FloatTensor # dtype = torch.cuda.FloatTensor # 取消注释以在GPU上运行 -# N 批量大小; D_in是输入尺寸; -# H是隐藏尺寸; D_out是输出尺寸. +# N 是一个batch的样本数量; D_in是输入维度; +# H 是隐藏层向量的维度; D_out是输出维度. N, D_in, H, D_out = 64, 1000, 100, 10 # 创建随机张量来保存输入和输出,并将它们包装在变量中. diff --git a/tutorial/zh/beginner_source/examples_nn/dynamic_net.py b/tutorial/zh/beginner_source/examples_nn/dynamic_net.py index 01e5fc89b..d2209915b 100644 --- a/tutorial/zh/beginner_source/examples_nn/dynamic_net.py +++ b/tutorial/zh/beginner_source/examples_nn/dynamic_net.py @@ -41,8 +41,8 @@ def forward(self, x): return y_pred -# N 批量大小; D_in是输入尺寸; -# H是隐藏尺寸; D_out是输出尺寸. +# N 是一个batch的样本数量; D_in是输入维度; +# H 是隐藏层向量的维度; D_out是输出维度. N, D_in, H, D_out = 64, 1000, 100, 10 # 创建随机张量来保存输入和输出,并将它们包装在变量中. diff --git a/tutorial/zh/beginner_source/examples_nn/two_layer_net_module.py b/tutorial/zh/beginner_source/examples_nn/two_layer_net_module.py index fd202844c..060cb7127 100644 --- a/tutorial/zh/beginner_source/examples_nn/two_layer_net_module.py +++ b/tutorial/zh/beginner_source/examples_nn/two_layer_net_module.py @@ -32,9 +32,8 @@ def forward(self, x): y_pred = self.linear2(h_relu) return y_pred - -# N 批量大小; D_in是输入尺寸; -# H是隐藏尺寸; D_out是输出尺寸. +# N 是一个batch的样本数量; D_in是输入维度; +# H 是隐藏层向量的维度; D_out是输出维度. N, D_in, H, D_out = 64, 1000, 100, 10 # 创建随机张量来保存输入和输出,并将它们包装在变量中. diff --git a/tutorial/zh/beginner_source/examples_nn/two_layer_net_nn.py b/tutorial/zh/beginner_source/examples_nn/two_layer_net_nn.py index ab46795fb..ef619834e 100644 --- a/tutorial/zh/beginner_source/examples_nn/two_layer_net_nn.py +++ b/tutorial/zh/beginner_source/examples_nn/two_layer_net_nn.py @@ -16,8 +16,8 @@ import torch from torch.autograd import Variable -# N 批量大小; D_in是输入尺寸; -# H是隐藏尺寸; D_out是输出尺寸. +# N 是一个batch的样本数量; D_in是输入维度; +# H 是隐藏层向量的维度; D_out是输出维度. N, D_in, H, D_out = 64, 1000, 100, 10 # 创建随机张量来保存输入和输出,并将它们包装在变量中. diff --git a/tutorial/zh/beginner_source/examples_nn/two_layer_net_optim.py b/tutorial/zh/beginner_source/examples_nn/two_layer_net_optim.py index 15bccf486..6d64b58db 100644 --- a/tutorial/zh/beginner_source/examples_nn/two_layer_net_optim.py +++ b/tutorial/zh/beginner_source/examples_nn/two_layer_net_optim.py @@ -16,8 +16,8 @@ import torch from torch.autograd import Variable -# N 批量大小; D_in是输入尺寸; -# H是隐藏尺寸; D_out是输出尺寸. +# N 是一个batch的样本数量; D_in是输入维度; +# H 是隐藏层向量的维度; D_out是输出维度. N, D_in, H, D_out = 64, 1000, 100, 10 # 创建随机张量来保存输入和输出,并将它们包装在变量中. diff --git a/tutorial/zh/beginner_source/examples_tensor/two_layer_net_tensor.py b/tutorial/zh/beginner_source/examples_tensor/two_layer_net_tensor.py index 5d9538174..5d30f1137 100644 --- a/tutorial/zh/beginner_source/examples_tensor/two_layer_net_tensor.py +++ b/tutorial/zh/beginner_source/examples_tensor/two_layer_net_tensor.py @@ -24,8 +24,8 @@ dtype = torch.FloatTensor # dtype = torch.cuda.FloatTensor # 取消注释以在GPU上运行 -# N 批量大小; D_in是输入尺寸; -# H是隐藏尺寸; D_out是输出尺寸. +# N 是一个batch的样本数量; D_in是输入维度; +# H 是隐藏层向量的维度; D_out是输出维度. N, D_in, H, D_out = 64, 1000, 100, 10 # 创建随机输入和输出数据