use correct loss

This commit is contained in:
Jeremy Howard 2020-12-26 09:25:42 -08:00
parent 432ab36dd6
commit 3916b71bdf
2 changed files with 92 additions and 118 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.gitattributes
models/
tmp/
*.bak

View File

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -85,7 +85,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -102,7 +102,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -175,7 +175,7 @@
"4 000016.jpg bicycle True"
]
},
"execution_count": 4,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -210,7 +210,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -230,7 +230,7 @@
"Name: fname, Length: 5011, dtype: object"
]
},
"execution_count": 5,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -241,7 +241,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -253,7 +253,7 @@
"Name: 0, dtype: object"
]
},
"execution_count": 6,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -274,7 +274,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -294,7 +294,7 @@
"Name: fname, Length: 5011, dtype: object"
]
},
"execution_count": 7,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -312,7 +312,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -361,7 +361,7 @@
"1 2 4"
]
},
"execution_count": 8,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -373,7 +373,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -425,7 +425,7 @@
"1 2 4 6"
]
},
"execution_count": 9,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -498,7 +498,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -514,7 +514,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -530,7 +530,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -539,7 +539,7 @@
"(4009, 1002)"
]
},
"execution_count": 12,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -550,7 +550,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -566,7 +566,7 @@
" Name: 4346, dtype: object)"
]
},
"execution_count": 13,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -585,7 +585,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -594,7 +594,7 @@
"'008663.jpg'"
]
},
"execution_count": 14,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -605,7 +605,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -614,7 +614,7 @@
"('005620.jpg', 'aeroplane')"
]
},
"execution_count": 15,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -634,7 +634,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -643,7 +643,7 @@
"('002549.jpg', 'tvmonitor')"
]
},
"execution_count": 16,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -672,7 +672,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -681,7 +681,7 @@
"(Path('/home/jhoward/.fastai/data/pascal_2007/train/002844.jpg'), ['train'])"
]
},
"execution_count": 17,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -703,7 +703,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -713,7 +713,7 @@
" TensorMultiCategory([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0.]))"
]
},
"execution_count": 18,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -748,7 +748,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -757,7 +757,7 @@
"(#1) ['dog']"
]
},
"execution_count": 19,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -778,7 +778,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -788,7 +788,7 @@
" TensorMultiCategory([0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]))"
]
},
"execution_count": 20,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -819,7 +819,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -840,7 +840,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -890,7 +890,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -906,7 +906,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -915,7 +915,7 @@
"torch.Size([64, 20])"
]
},
"execution_count": 24,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -935,7 +935,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -945,7 +945,7 @@
" grad_fn=<AliasBackward>)"
]
},
"execution_count": 25,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -970,7 +970,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -1013,7 +1013,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1022,7 +1022,7 @@
"TensorImage(1.0342, grad_fn=<AliasBackward>)"
]
},
"execution_count": 27,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1067,7 +1067,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1076,7 +1076,7 @@
"('Hello Jeremy.', 'Ahoy! Jeremy.')"
]
},
"execution_count": 28,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1095,7 +1095,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1104,7 +1104,7 @@
"('Bonjour Jeremy.', 'Bonjour Sylvain.')"
]
},
"execution_count": 29,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1123,7 +1123,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1238,7 +1238,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1257,7 +1257,7 @@
"(#2) [0.10477833449840546,0.9314740300178528]"
]
},
"execution_count": 31,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1276,7 +1276,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1295,7 +1295,7 @@
"(#2) [0.10477833449840546,0.9429482221603394]"
]
},
"execution_count": 32,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1314,7 +1314,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1341,7 +1341,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1350,7 +1350,7 @@
"TensorImage(0.9567)"
]
},
"execution_count": 34,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1368,7 +1368,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1435,7 +1435,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -1444,7 +1444,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -1461,7 +1461,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1470,7 +1470,7 @@
"(#50) [Path('01'),Path('01.obj'),Path('02'),Path('02.obj'),Path('03'),Path('03.obj'),Path('04'),Path('04.obj'),Path('05'),Path('05.obj')...]"
]
},
"execution_count": 38,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1488,7 +1488,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1497,7 +1497,7 @@
"(#1000) [Path('01/depth.cal'),Path('01/frame_00003_pose.txt'),Path('01/frame_00003_rgb.jpg'),Path('01/frame_00004_pose.txt'),Path('01/frame_00004_rgb.jpg'),Path('01/frame_00005_pose.txt'),Path('01/frame_00005_rgb.jpg'),Path('01/frame_00006_pose.txt'),Path('01/frame_00006_rgb.jpg'),Path('01/frame_00007_pose.txt')...]"
]
},
"execution_count": 39,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1515,7 +1515,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1524,7 +1524,7 @@
"Path('13/frame_00349_pose.txt')"
]
},
"execution_count": 40,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1544,7 +1544,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1553,7 +1553,7 @@
"(480, 640)"
]
},
"execution_count": 41,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1565,7 +1565,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1575,7 +1575,7 @@
"<PIL.Image.Image image mode=RGB size=160x120 at 0x7F2DF0A49690>"
]
},
"execution_count": 42,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1593,7 +1593,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -1614,7 +1614,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1623,7 +1623,7 @@
"tensor([384.6370, 259.4787])"
]
},
"execution_count": 44,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1645,7 +1645,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -1675,7 +1675,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1705,7 +1705,7 @@
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1714,7 +1714,7 @@
"(torch.Size([64, 3, 240, 320]), torch.Size([64, 1, 2]))"
]
},
"execution_count": 47,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1740,7 +1740,7 @@
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1749,7 +1749,7 @@
"TensorPoint([[-0.3375, 0.2193]], device='cuda:6')"
]
},
"execution_count": 48,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1788,7 +1788,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -1804,7 +1804,7 @@
},
{
"cell_type": "code",
"execution_count": 50,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -1822,7 +1822,7 @@
},
{
"cell_type": "code",
"execution_count": 51,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1859,7 +1859,7 @@
},
{
"cell_type": "code",
"execution_count": 52,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1868,7 +1868,7 @@
"FlattenedLoss of MSELoss()"
]
},
"execution_count": 52,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -1890,7 +1890,7 @@
},
{
"cell_type": "code",
"execution_count": 53,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -1909,7 +1909,7 @@
"SuggestedLRs(lr_min=0.005754399299621582, lr_steep=0.033113110810518265)"
]
},
"execution_count": 53,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
},
@ -1939,7 +1939,7 @@
},
{
"cell_type": "code",
"execution_count": 54,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -2027,7 +2027,7 @@
},
{
"cell_type": "code",
"execution_count": 55,
"execution_count": null,
"metadata": {},
"outputs": [
{
@ -2036,7 +2036,7 @@
"0.01"
]
},
"execution_count": 55,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
@ -2054,10 +2054,8 @@
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {
"scrolled": false
},
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
@ -2174,31 +2172,6 @@
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": false,
"sideBar": true,
"skip_h1_title": true,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
}
},
"nbformat": 4,