Skip to content

Commit

Permalink
apply v1.10.1, pytorch/tutorials@444fbd1 (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
9bow committed Jan 23, 2022
1 parent efe11eb commit a9f03c6
Show file tree
Hide file tree
Showing 29 changed files with 4,550 additions and 36 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ PyTorch์—์„œ ์ œ๊ณตํ•˜๋Š” ํŠœํ† ๋ฆฌ์–ผ์˜ ํ•œ๊ตญ์–ด ๋ฒˆ์—ญ์„ ์œ„ํ•œ ์ €์žฅ์†Œ

## ์›๋ฌธ

ํ˜„์žฌ PyTorch v1.9 ํŠœํ† ๋ฆฌ์–ผ ๋ฒˆ์—ญ์ด ์ง„ํ–‰ ์ค‘์ž…๋‹ˆ๋‹ค. ([pytorch/tutorials@2571e95](https://github.com/pytorch/tutorials/commit/2571e95df42b8ed46d11ac9827c637fa4e826dfe) ๊ธฐ์ค€)
ํ˜„์žฌ PyTorch v1.10.1 ํŠœํ† ๋ฆฌ์–ผ([pytorch/tutorials@444fbd1](https://github.com/pytorch/tutorials/commit/444fbd16f2ddf9967baf8b06e83867a141b071c2) ๊ธฐ์ค€) ๋ฒˆ์—ญ์ด ์ง„ํ–‰ ์ค‘์ž…๋‹ˆ๋‹ค.

์ตœ์‹  ๋ฒ„์ „์˜ ํŠœํ† ๋ฆฌ์–ผ(๊ณต์‹, ์˜์–ด)์€ [PyTorch tutorials ์‚ฌ์ดํŠธ](https://pytorch.org/tutorials) ๋ฐ [PyTorch tutorials ์ €์žฅ์†Œ](https://github.com/pytorch/tutorials)๋ฅผ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”.

Expand All @@ -46,5 +46,5 @@ v1.0 ์ดํ›„ ๋ฒˆ์—ญ์€ ๋ณ„๋„ ์ €์žฅ์†Œ๋กœ ๊ด€๋ฆฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. [์ด ์ €์žฅ
| 0.3.1 | [PyTorch-tutorials-kr-0.3.1](https://9bow.github.io/PyTorch-tutorials-kr-0.3.1) | [GitHub ์ €์žฅ์†Œ](https://github.com/9bow/PyTorch-tutorials-kr-0.3.1) |

---
This is a project to translate [pytorch/tutorials@2571e95](https://github.com/pytorch/tutorials/commit/2571e95df42b8ed46d11ac9827c637fa4e826dfe) into Korean.
This is a project to translate [pytorch/tutorials@444fbd1](https://github.com/pytorch/tutorials/commit/444fbd16f2ddf9967baf8b06e83867a141b071c2) into Korean.
For the latest version, please visit to the [official PyTorch tutorials repo](https://github.com/pytorch/tutorials).
6 changes: 3 additions & 3 deletions advanced_source/torch_script_custom_ops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -579,13 +579,13 @@ custom operator, that loads and executes a serialized TorchScript model:
}
// Deserialize the ScriptModule from a file using torch::jit::load().
std::shared_ptr<torch::jit::script::Module> module = torch::jit::load(argv[1]);
torch::jit::script::Module module = torch::jit::load(argv[1]);
std::vector<torch::jit::IValue> inputs;
inputs.push_back(torch::randn({4, 8}));
inputs.push_back(torch::randn({8, 5}));
torch::Tensor output = module->forward(std::move(inputs)).toTensor();
torch::Tensor output = module.forward(std::move(inputs)).toTensor();
std::cout << output << std::endl;
}
Expand Down Expand Up @@ -1029,5 +1029,5 @@ visible to TorchScript:
>>> import torch
>>> torch.ops.load_library("warp_perspective.so")
>>> print(torch.ops.custom.warp_perspective)
>>> print(torch.ops.my_ops.warp_perspective)
<built-in method custom::warp_perspective of PyCapsule object at 0x7ff51c5b7bd0>
2 changes: 1 addition & 1 deletion beginner_source/basics/optimization_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def forward(self, x):
#####################################
# ํ•™์Šต ๋‹จ๊ณ„(loop)์—์„œ ์ตœ์ ํ™”๋Š” ์„ธ๋‹จ๊ณ„๋กœ ์ด๋ค„์ง‘๋‹ˆ๋‹ค:
# * ``optimizer.zero_grad()``\ ๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ๋ชจ๋ธ ๋งค๊ฐœ๋ณ€์ˆ˜์˜ ๋ณ€ํ™”๋„๋ฅผ ์žฌ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ ๋ณ€ํ™”๋„๋Š” ๋”ํ•ด์ง€๊ธฐ(add up) ๋•Œ๋ฌธ์— ์ค‘๋ณต ๊ณ„์‚ฐ์„ ๋ง‰๊ธฐ ์œ„ํ•ด ๋ฐ˜๋ณตํ•  ๋•Œ๋งˆ๋‹ค ๋ช…์‹œ์ ์œผ๋กœ 0์œผ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
# * ``loss.backward()``\ ๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ์˜ˆ์ธก ์†์‹ค(prediction loss)์„ ์—ญ์ „ํŒŒํ•ฉ๋‹ˆ๋‹ค. PyTorch๋Š” ๊ฐ ๋งค๊ฐœ๋ณ€์ˆ˜์— ๋Œ€ํ•œ ์†์‹ค์˜ ๋ณ€ํ™”๋„๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
# * ``loss.backwards()``\ ๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ์˜ˆ์ธก ์†์‹ค(prediction loss)์„ ์—ญ์ „ํŒŒํ•ฉ๋‹ˆ๋‹ค. PyTorch๋Š” ๊ฐ ๋งค๊ฐœ๋ณ€์ˆ˜์— ๋Œ€ํ•œ ์†์‹ค์˜ ๋ณ€ํ™”๋„๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
# * ๋ณ€ํ™”๋„๋ฅผ ๊ณ„์‚ฐํ•œ ๋’ค์—๋Š” ``optimizer.step()``\ ์„ ํ˜ธ์ถœํ•˜์—ฌ ์—ญ์ „ํŒŒ ๋‹จ๊ณ„์—์„œ ์ˆ˜์ง‘๋œ ๋ณ€ํ™”๋„๋กœ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์กฐ์ •ํ•ฉ๋‹ˆ๋‹ค.


Expand Down
16 changes: 10 additions & 6 deletions beginner_source/blitz/autograd_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
ํ•™์Šต ๋‹จ๊ณ„๋ฅผ ํ•˜๋‚˜๋งŒ ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—์„œ๋Š” ``torchvision`` ์—์„œ ๋ฏธ๋ฆฌ ํ•™์Šต๋œ resnet18 ๋ชจ๋ธ์„ ๋ถˆ๋Ÿฌ์˜ต๋‹ˆ๋‹ค.
3์ฑ„๋„์งœ๋ฆฌ ๋†’์ด์™€ ๋„“์ด๊ฐ€ 64์ธ ์ด๋ฏธ์ง€ ํ•˜๋‚˜๋ฅผ ํ‘œํ˜„ํ•˜๋Š” ๋ฌด์ž‘์œ„์˜ ๋ฐ์ดํ„ฐ ํ…์„œ๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ์ด์— ์ƒ์‘ํ•˜๋Š” ``label(์ •๋‹ต)`` ์„
๋ฌด์ž‘์œ„ ๊ฐ’์œผ๋กœ ์ดˆ๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค.
๋ฌด์ž‘์œ„ ๊ฐ’์œผ๋กœ ์ดˆ๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค. ๋ฏธ๋ฆฌ ํ•™์Šต๋œ ๋ชจ๋ธ์˜ ์ •๋‹ต(label)์€ (1, 1000)์˜ ๋ชจ์–‘(shape)์„ ๊ฐ–์Šต๋‹ˆ๋‹ค.
.. note::
์ด ํŠœํ† ๋ฆฌ์–ผ์€ (ํ…์„œ๋ฅผ CUDA๋กœ ์ด๋™ํ•˜๋”๋ผ๋„) GPU์—์„œ๋Š” ๋™์ž‘ํ•˜์ง€ ์•Š์œผ๋ฉฐ CPU์—์„œ๋งŒ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.
"""
import torch, torchvision
model = torchvision.models.resnet18(pretrained=True)
Expand All @@ -59,8 +63,8 @@

############################################################
# ๋‹ค์Œ์œผ๋กœ, ์˜ตํ‹ฐ๋งˆ์ด์ €(optimizer)๋ฅผ ๋ถˆ๋Ÿฌ์˜ต๋‹ˆ๋‹ค.
# ์ด ์˜ˆ์ œ์—์„œ๋Š” ํ•™์Šต์œจ(learning rate) 0.1๊ณผ ๋ชจ๋ฉ˜ํ…€(momentum) 0.9๋ฅผ ๊ฐ–๋Š” SGD์ž…๋‹ˆ๋‹ค.
# ์˜ตํ‹ฐ๋งˆ์ด์ €(optimizer)์— ๋ชจ๋ธ์˜ ๋ชจ๋“  ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.
# ์ด ์˜ˆ์ œ์—์„œ๋Š” ํ•™์Šต์œจ(learning rate) 0.1๊ณผ `๋ชจ๋ฉ˜ํ…€(momentum) <https://towardsdatascience.com/stochastic-gradient-descent-with-momentum-a84097641a5d>`__
# 0.9๋ฅผ ๊ฐ–๋Š” SGD์ž…๋‹ˆ๋‹ค. ์˜ตํ‹ฐ๋งˆ์ด์ €(optimizer)์— ๋ชจ๋ธ์˜ ๋ชจ๋“  ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.
#

optim = torch.optim.SGD(model.parameters(), lr=1e-2, momentum=0.9)
Expand Down Expand Up @@ -234,7 +238,7 @@
# .. note::
# **PyTorch์—์„œ DAG๋“ค์€ ๋™์ (dynamic)์ž…๋‹ˆ๋‹ค.**
# ์ฃผ๋ชฉํ•ด์•ผ ํ•  ์ค‘์š”ํ•œ ์ ์€ ๊ทธ๋ž˜ํ”„๊ฐ€ ์ฒ˜์Œ๋ถ€ํ„ฐ(from scratch) ๋‹ค์‹œ ์ƒ์„ฑ๋œ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค; ๋งค๋ฒˆ ``.backward()`` ๊ฐ€
# ํ˜ธ์ถœ๋˜๊ณ  ๋‚˜๋ฉด, autograd๋Š” ์ƒˆ๋กœ์šด ๊ทธ๋ž˜ํ”„๋ฅผ ์ฑ„์šฐ๊ธฐ(populate) ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ์  ๋•๋ถ„์— ๋ชจ๋ธ์—์„œ
# ํ˜ธ์ถœ๋˜๊ณ  ๋‚˜๋ฉด, autograd๋Š” ์ƒˆ๋กœ์šด ๊ทธ๋ž˜ํ”„๋ฅผ ์ฑ„์šฐ๊ธฐ(populate) ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ์  ๋•๋ถ„์— ๋ชจ๋ธ์—์„œ
# ํ๋ฆ„ ์ œ์–ด(control flow) ๊ตฌ๋ฌธ๋“ค์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค; ๋งค๋ฒˆ ๋ฐ˜๋ณต(iteration)ํ•  ๋•Œ๋งˆ๋‹ค ํ•„์š”ํ•˜๋ฉด
# ๋ชจ์–‘(shape)์ด๋‚˜ ํฌ๊ธฐ(size), ์—ฐ์‚ฐ(operation)์„ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
#
Expand Down Expand Up @@ -286,14 +290,14 @@
model.fc = nn.Linear(512, 10)

######################################################################
# ์ด์ œ ``model.fc`` ๋ฅผ ์ œ์™ธํ•œ ๋ชจ๋ธ์˜ ๋ชจ๋“  ๋งค๊ฐœ๋ณ€์ˆ˜๋“ค์ด ๊ณ ์ •๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
# ์ด์ œ ``model.fc`` ๋ฅผ ์ œ์™ธํ•œ ๋ชจ๋ธ์˜ ๋ชจ๋“  ๋งค๊ฐœ๋ณ€์ˆ˜๋“ค์ด ๊ณ ์ •๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
# ๋ณ€ํ™”๋„๋ฅผ ๊ณ„์‚ฐํ•˜๋Š” ์œ ์ผํ•œ ๋งค๊ฐœ๋ณ€์ˆ˜๋Š” ``model.fc`` ์˜ ๊ฐ€์ค‘์น˜(weight)์™€ ํŽธํ–ฅ(bias)๋ฟ์ž…๋‹ˆ๋‹ค.

# ๋ถ„๋ฅ˜๊ธฐ๋งŒ ์ตœ์ ํ™”ํ•ฉ๋‹ˆ๋‹ค.
optimizer = optim.SGD(model.parameters(), lr=1e-2, momentum=0.9)

##########################################################################
# ์˜ตํ‹ฐ๋งˆ์ด์ €(optimizer)์— ๋ชจ๋“  ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ๋“ฑ๋กํ•˜๋”๋ผ๋„,
# ์˜ตํ‹ฐ๋งˆ์ด์ €(optimizer)์— ๋ชจ๋“  ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ๋“ฑ๋กํ•˜๋”๋ผ๋„,
# ๋ณ€ํ™”๋„๋ฅผ ๊ณ„์‚ฐ(ํ•˜๊ณ  ๊ฒฝ์‚ฌํ•˜๊ฐ•๋ฒ•์œผ๋กœ ๊ฐฑ์‹ )ํ•  ์ˆ˜ ์žˆ๋Š” ๋งค๊ฐœ๋ณ€์ˆ˜๋“ค์€ ๋ถ„๋ฅ˜๊ธฐ์˜ ๊ฐ€์ค‘์น˜์™€ ํŽธํ–ฅ๋ฟ์ž…๋‹ˆ๋‹ค.
#
# ์ปจํ…์ŠคํŠธ ๋งค๋‹ˆ์ €(context manager)์— `torch.no_grad() <https://pytorch.org/docs/stable/generated/torch.no_grad.html>`__
Expand Down
17 changes: 7 additions & 10 deletions beginner_source/blitz/cifar10_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def imshow(img):
# ์ด๋ฏธ์ง€ ๋ณด์—ฌ์ฃผ๊ธฐ
imshow(torchvision.utils.make_grid(images))
# ์ •๋‹ต(label) ์ถœ๋ ฅ
print(' '.join('%5s' % classes[labels[j]] for j in range(batch_size)))
print(' '.join(f'{classes[labels[j]]:5s}' for j in range(batch_size)))


########################################################################
Expand Down Expand Up @@ -181,8 +181,7 @@ def forward(self, x):
# ํ†ต๊ณ„๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.
running_loss += loss.item()
if i % 2000 == 1999: # print every 2000 mini-batches
print('[%d, %5d] loss: %.3f' %
(epoch + 1, i + 1, running_loss / 2000))
print(f'[{epoch + 1}, {i + 1:5d}] loss: {running_loss / 2000:.3f}')
running_loss = 0.0

print('Finished Training')
Expand Down Expand Up @@ -213,7 +212,7 @@ def forward(self, x):

# ์ด๋ฏธ์ง€๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.
imshow(torchvision.utils.make_grid(images))
print('GroundTruth: ', ' '.join('%5s' % classes[labels[j]] for j in range(4)))
print('GroundTruth: ', ' '.join(f'{classes[labels[j]]:5s}' for j in range(4)))

########################################################################
# ์ด์ œ, ์ €์žฅํ–ˆ๋˜ ๋ชจ๋ธ์„ ๋ถˆ๋Ÿฌ์˜ค๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค (์ฃผ: ๋ชจ๋ธ์„ ์ €์žฅํ•˜๊ณ  ๋‹ค์‹œ ๋ถˆ๋Ÿฌ์˜ค๋Š”
Expand All @@ -233,7 +232,7 @@ def forward(self, x):
# ๋”ฐ๋ผ์„œ, ๊ฐ€์žฅ ๋†’์€ ๊ฐ’์„ ๊ฐ–๋Š” ์ธ๋ฑ์Šค(index)๋ฅผ ๋ฝ‘์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค:
_, predicted = torch.max(outputs, 1)

print('Predicted: ', ' '.join('%5s' % classes[predicted[j]]
print('Predicted: ', ' '.join(f'{classes[predicted[j]]:5s}'
for j in range(4)))

########################################################################
Expand All @@ -254,8 +253,7 @@ def forward(self, x):
total += labels.size(0)
correct += (predicted == labels).sum().item()

print('Accuracy of the network on the 10000 test images: %d %%' % (
100 * correct / total))
print(f'Accuracy of the network on the 10000 test images: {100 * correct // total} %')

########################################################################
# (10๊ฐ€์ง€ ๋ถ„๋ฅ˜ ์ค‘์— ํ•˜๋‚˜๋ฅผ ๋ฌด์ž‘์œ„๋กœ) ์ฐ์—ˆ์„ ๋•Œ์˜ ์ •ํ™•๋„์ธ 10% ๋ณด๋‹ค๋Š” ๋‚˜์•„๋ณด์ž…๋‹ˆ๋‹ค.
Expand Down Expand Up @@ -283,8 +281,7 @@ def forward(self, x):
# ๊ฐ ๋ถ„๋ฅ˜๋ณ„ ์ •ํ™•๋„(accuracy)๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค
for classname, correct_count in correct_pred.items():
accuracy = 100 * float(correct_count) / total_pred[classname]
print("Accuracy for class {:5s} is: {:.1f} %".format(classname,
accuracy))
print(f'Accuracy for class: {classname:5s} is {accuracy:.1f} %')

########################################################################
# ์ž, ์ด์ œ ๋‹ค์Œ์œผ๋กœ ๋ฌด์—‡์„ ํ•ด๋ณผ๊นŒ์š”?
Expand All @@ -297,7 +294,7 @@ def forward(self, x):
#
# ๋จผ์ € (CUDA๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉด) ์ฒซ๋ฒˆ์งธ CUDA ์žฅ์น˜๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค:

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')

# CUDA ๊ธฐ๊ธฐ๊ฐ€ ์กด์žฌํ•œ๋‹ค๋ฉด, ์•„๋ž˜ ์ฝ”๋“œ๊ฐ€ CUDA ์žฅ์น˜๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค:

Expand Down
9 changes: 7 additions & 2 deletions beginner_source/data_loading_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@
# 0805personali01.jpg,27,83,27,98, ... 84,134
# 1084239450_e76e00b7e7.jpg,70,236,71,257, ... ,128,312
#
# ์ด์ œ CSV ํŒŒ์ผ์„ ๋ถˆ๋Ÿฌ์™€์„œ (N, 2) ๋ฐฐ์—ด์•ˆ์— ์žˆ๋Š” ๋žœ๋“œ๋งˆํฌ๋“ค์„ ์žก์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.
# N์€ ๋žœ๋“œ๋งˆํฌ(landmarks)์˜ ๊ฐœ์ˆ˜์ž…๋‹ˆ๋‹ค.
# ์ด์ œ CSV์—์„œ ์ด๋ฏธ์ง€ ์ด๋ฆ„๊ณผ ๊ทธ์— ํ•ด๋‹นํ•˜๋Š” ๋ฐ์ดํ„ฐ(annotation)์„ ๊ฐ€์ ธ์™€ ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์˜ˆ์‹œ๋กœ person-7.jpg๊ฐ€ ์žˆ๋Š”
# 65๋ฒˆ์งธ ์ค„(row index number)์„ ๊ฐ€์ ธ์˜ค๊ฒ ์Šต๋‹ˆ๋‹ค.์ด๋ฏธ์ง€ ์ด๋ฆ„์„ ์ฝ์–ด ``img_name`` ์— ์ €์žฅํ•˜๊ณ , ๋ฐ์ดํ„ฐ๋Š” (L, 2)
# ๋ฐฐ์—ด์ธ ``landmarks`` ์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ์ด ๋•Œ L์€ ํ•ด๋‹น ํ–‰์˜ ๋žœ๋“œ๋งˆํฌ์˜ ๊ฐœ์ˆ˜์ž…๋‹ˆ๋‹ค.

landmarks_frame = pd.read_csv('data/faces/face_landmarks.csv')

Expand Down Expand Up @@ -396,6 +397,10 @@ def show_landmarks_batch(sample_batched):

plt.title('Batch from dataloader')

# Windows๋ฅผ ์‚ฌ์šฉ ์ค‘์ด๋ผ๋ฉด, ๋‹ค์Œ ์ค„์˜ ์ฃผ์„์„ ์ œ๊ฑฐํ•˜๊ณ  for ๋ฐ˜๋ณต๋ฌธ์„ ๋“ค์—ฌ์“ฐ๊ธฐํ•ฉ๋‹ˆ๋‹ค.
# "num_workers"๋ฅผ 0์œผ๋กœ ๋ณ€๊ฒฝํ•ด์•ผ ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

# if __name__ == '__main__':
for i_batch, sample_batched in enumerate(dataloader):
print(i_batch, sample_batched['image'].size(),
sample_batched['landmarks'].size())
Expand Down
2 changes: 1 addition & 1 deletion beginner_source/examples_nn/dynamic_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---------------------------------------------------------------
PyTorch ๋™์  ๊ทธ๋ž˜ํ”„์˜ ๊ฐ•๋ ฅํ•จ์„ ๋ณด์—ฌ์ฃผ๊ธฐ ์œ„ํ•ด, ๋งค์šฐ ์ด์ƒํ•œ ๋ชจ๋ธ์„ ๊ตฌํ˜„ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค:
๊ฐ ์ˆœ์ „ํŒŒ ๋‹จ๊ณ„์—์„œ 3 ~ 5 ์‚ฌ์ด์˜ ์ž„์˜์˜ ์ˆซ์ž๋ฅผ ์„ ํƒํ•˜์—ฌ ๋‹ค์ฐจํ•ญ๋“ค์—์„œ ์‚ฌ์šฉํ•˜๊ณ , ๋™์ผํ•œ ๊ฐ€์ค‘์น˜๋ฅผ ์—ฌ๋Ÿฌ๋ฒˆ
๊ฐ ์ˆœ์ „ํŒŒ ๋‹จ๊ณ„์—์„œ 4 ~ 5 ์‚ฌ์ด์˜ ์ž„์˜์˜ ์ˆซ์ž๋ฅผ ์„ ํƒํ•˜์—ฌ ๋‹ค์ฐจํ•ญ๋“ค์—์„œ ์‚ฌ์šฉํ•˜๊ณ , ๋™์ผํ•œ ๊ฐ€์ค‘์น˜๋ฅผ ์—ฌ๋Ÿฌ๋ฒˆ
์žฌ์‚ฌ์šฉํ•˜์—ฌ 4์ฐจํ•ญ๊ณผ 5์ฐจํ•ญ์„ ๊ณ„์‚ฐํ•˜๋Š” 3-5์ฐจ ๋‹คํ•ญ์‹์ž…๋‹ˆ๋‹ค.
"""
import random
Expand Down
29 changes: 29 additions & 0 deletions beginner_source/introyt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
`Introduction <introyt/introyt1_tutorial.html>`_ ||
`Tensors <introyt/tensors_deeper_tutorial.html>`_ ||
`Autograd <introyt/autogradyt_tutorial.html>`_ ||
`Building Models <introyt/modelsyt_tutorial.html>`_ ||
`TensorBoard Support <introyt/tensorboardyt_tutorial.html>`_ ||
`Training Models <introyt/trainingyt.html>`_ ||
`Model Understanding <introyt/captumyt.html>`_

Introduction to PyTorch - YouTube Series
========================================

Authors:
`Brad Heintz <https://github.com/fbbradheintz>`_

This tutorial follows along with the `PyTorch Beginner Series <https://www.youtube.com/playlist?list=PL_lsbAsL_o2CTlGHgMxNrKhzP97BaG9ZN>`_ on youtube.

`This tutorial assumes a basic familiarity with Python and Deep Learning concepts.`

Running the Tutorial Code
-------------------------
You can run this tutorial in a couple of ways:

- **In the cloud**: This is the easiest way to get started! Each section has a Colab link at the top, which opens a notebook with the code in a fully-hosted environment. Pro tip: Use Colab with a GPU runtime to speed up operations *Runtime > Change runtime type > GPU*
- **Locally**: This option requires you to setup PyTorch and TorchVision first on your local machine (`installation instructions <https://pytorch.org/get-started/locally/>`_). Download the notebook or copy the code into your favorite IDE.

.. include:: /beginner_source/introyt/tocyt.txt

.. toctree::
:hidden:
34 changes: 34 additions & 0 deletions beginner_source/introyt/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Introduction to PyTorch on YouTube
----------------------------------

1. introyt.rst
Introduction to PyTorch - Youtube Series
https://tutorials.pytorch.kr/beginner/introyt/introyt.html

2. introyt1_tutorial.py
Introduction to PyTorch
https://tutorials.pytorch.kr/beginner/introyt/introyt1_tutorial.html

3. tensors_deeper_tutorial.py
PyTorch Tensors
https://tutorials.pytorch.kr/beginner/introyt/tensors_deeper_tutorial.html

4. autogradyt_tutorial.py
The Fundamentals of Autograd
https://tutorials.pytorch.kr/beginner/introyt/autogradyt_tutorial.html

5. modelsyt_tutorial.py
Building Models with PyTorch
https://tutorials.pytorch.kr/beginner/introyt/modelsyt_tutorial.html

6. tensorboardyt_tutorial.py
PyTorch TensorBoard Support
https://tutorials.pytorch.kr/beginner/introyt/tensorboardyt_tutorial.html

7. trainingyt_tutorial.py
Training with PyTorch
https://tutorials.pytorch.kr/beginner/introyt/trainingyt_tutorial.html

8. captumyt_tutorial.py
Model Understanding with Captum
https://tutorials.pytorch.kr/beginner/introyt/captumyt_tutorial.html
Loading

0 comments on commit a9f03c6

Please sign in to comment.