Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
fix pickle protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
keon committed Aug 27, 2019
1 parent 0d0136b commit 0805d8d
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 84,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -11,7 +11,7 @@
},
{
"cell_type": "code",
"execution_count": 85,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -20,7 +20,7 @@
},
{
"cell_type": "code",
"execution_count": 86,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -39,13 +39,6 @@
"print(w.grad)\n",
"print('l을 w로 미분한 값은 {}'.format(w.grad))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -64,7 +57,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
"version": "3.7.0"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@
print(w.grad)
print('l을 w로 미분한 값은 {}'.format(w.grad))




Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,3 @@ def forward(self, input_tensor):
new_model.eval()
print('벡터 [-1, 1]이 레이블 1을 가질 확률은 {}'.format(new_model(torch.FloatTensor([-1,1])).item()))




118 changes: 43 additions & 75 deletions 03-파이토치로_구현하는_인공_신경망/image_recovery.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# 이미지 처리를 위해 만들어 두었던 weird_function() 함수에 실수로 버그가 들어가 100×100 픽셀의 오염된 미미지가 만들어졌습니다. 이 오염된 이미지와 오염되기 전 원본 이미지를 동시에 파일로 저장하려고 했으나, 모종의 이유로 원본 이미지 파일은 삭제된 상황입니다. 다행히도 weird_function()의 소스코드는 남아 있습니다. 오염된 이미지와 weird_function()을 활용해 원본 이미지를 복원해봅시다.
# *참고자료: https://github.com/jcjohnson/pytorch-examples, NYU Intro2ML*


import torch
import pickle
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -54,9 +53,3 @@ def distance_loss(hypothesis, broken_image):

plt.imshow(random_tensor.view(100,100).data)







Binary file modified 03-파이토치로_구현하는_인공_신경망/model.pt
Binary file not shown.
Binary file not shown.
22 changes: 11 additions & 11 deletions 03-파이토치로_구현하는_인공_신경망/tensor_basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"tensor([[ 1, 2, 3],\n",
" [ 4, 5, 6],\n",
" [ 7, 8, 9]])\n",
"tensor([[1, 2, 3],\n",
" [4, 5, 6],\n",
" [7, 8, 9]])\n",
"Size: torch.Size([3, 3])\n",
"Shape: torch.Size([3, 3])\n",
"랭크(차원): 2\n"
Expand All @@ -46,9 +46,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"tensor([[[ 1, 2, 3],\n",
" [ 4, 5, 6],\n",
" [ 7, 8, 9]]])\n",
"tensor([[[1, 2, 3],\n",
" [4, 5, 6],\n",
" [7, 8, 9]]])\n",
"Size: torch.Size([1, 3, 3])\n",
"Shape: torch.Size([1, 3, 3])\n",
"랭크(차원): 3\n"
Expand All @@ -73,9 +73,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"tensor([[ 1, 2, 3],\n",
" [ 4, 5, 6],\n",
" [ 7, 8, 9]])\n",
"tensor([[1, 2, 3],\n",
" [4, 5, 6],\n",
" [7, 8, 9]])\n",
"Size: torch.Size([3, 3])\n",
"Shape: torch.Size([3, 3])\n",
"랭크(차원): 2\n"
Expand All @@ -100,7 +100,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"tensor([ 1, 2, 3, 4, 5, 6, 7, 8, 9])\n",
"tensor([1, 2, 3, 4, 5, 6, 7, 8, 9])\n",
"Size: torch.Size([9])\n",
"Shape: torch.Size([9])\n",
"랭크(차원): 1\n"
Expand Down Expand Up @@ -153,7 +153,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
"version": "3.7.0"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 0805d8d

Please sign in to comment.