未验证 提交 241823fc 编写于 作者: saxon_zh's avatar saxon_zh 提交者: GitHub

Fix Bug: modify PetModel to PetNet (#901)

* upgrade code to 2.0-beta

* add high level api doc

* add define callback/metric/loss chapter

* add define callback/metric/loss chapter

* rerun code with 2.0-beta whl

* fix bug: modify PetModel to PetNet
上级 f88c280b
......@@ -34,7 +34,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 1,
"metadata": {},
"outputs": [
{
......@@ -43,7 +43,7 @@
"'2.0.0-beta0'"
]
},
"execution_count": 21,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
......@@ -173,7 +173,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 2,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
......@@ -235,7 +235,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
......@@ -388,7 +388,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 4,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
......@@ -464,7 +464,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 5,
"metadata": {
"colab": {},
"colab_type": "code",
......@@ -527,7 +527,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 6,
"metadata": {
"colab": {},
"colab_type": "code",
......@@ -587,7 +587,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 7,
"metadata": {
"colab": {},
"colab_type": "code",
......@@ -648,7 +648,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 8,
"metadata": {
"colab": {},
"colab_type": "code",
......@@ -724,7 +724,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 9,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
......@@ -743,28 +743,28 @@
"--------------------------------------------------------------------------------\n",
" Layer (type) Input Shape Output Shape Param #\n",
"================================================================================\n",
" Conv2d-38 [-1, 3, 160, 160] [-1, 32, 80, 80] 896\n",
" BatchNorm2d-14 [-1, 32, 80, 80] [-1, 32, 80, 80] 128\n",
" ReLU-14 [-1, 32, 80, 80] [-1, 32, 80, 80] 0\n",
" ReLU-17 [-1, 256, 20, 20] [-1, 256, 20, 20] 0\n",
" Conv2d-49 [-1, 128, 20, 20] [-1, 128, 20, 20] 1,152\n",
" Conv2d-50 [-1, 128, 20, 20] [-1, 256, 20, 20] 33,024\n",
"SeparableConv2d-17 [-1, 128, 20, 20] [-1, 256, 20, 20] 0\n",
" BatchNorm2d-17 [-1, 256, 20, 20] [-1, 256, 20, 20] 1,024\n",
" Conv2d-51 [-1, 256, 20, 20] [-1, 256, 20, 20] 2,304\n",
" Conv2d-52 [-1, 256, 20, 20] [-1, 256, 20, 20] 65,792\n",
"SeparableConv2d-18 [-1, 256, 20, 20] [-1, 256, 20, 20] 0\n",
" MaxPool2d-9 [-1, 256, 20, 20] [-1, 256, 10, 10] 0\n",
" Conv2d-53 [-1, 128, 20, 20] [-1, 256, 10, 10] 33,024\n",
" Encoder-9 [-1, 128, 20, 20] [-1, 256, 10, 10] 0\n",
" ReLU-21 [-1, 32, 80, 80] [-1, 32, 80, 80] 0\n",
"ConvTranspose2d-17 [-1, 64, 80, 80] [-1, 32, 80, 80] 18,464\n",
" BatchNorm2d-21 [-1, 32, 80, 80] [-1, 32, 80, 80] 128\n",
"ConvTranspose2d-18 [-1, 32, 80, 80] [-1, 32, 80, 80] 9,248\n",
" Upsample-8 [-1, 64, 80, 80] [-1, 64, 160, 160] 0\n",
" Conv2d-57 [-1, 64, 160, 160] [-1, 32, 160, 160] 2,080\n",
" Decoder-9 [-1, 64, 80, 80] [-1, 32, 160, 160] 0\n",
" Conv2d-58 [-1, 32, 160, 160] [-1, 4, 160, 160] 1,156\n",
" Conv2d-1 [-1, 3, 160, 160] [-1, 32, 80, 80] 896\n",
" BatchNorm2d-1 [-1, 32, 80, 80] [-1, 32, 80, 80] 128\n",
" ReLU-1 [-1, 32, 80, 80] [-1, 32, 80, 80] 0\n",
" ReLU-4 [-1, 256, 20, 20] [-1, 256, 20, 20] 0\n",
" Conv2d-12 [-1, 128, 20, 20] [-1, 128, 20, 20] 1,152\n",
" Conv2d-13 [-1, 128, 20, 20] [-1, 256, 20, 20] 33,024\n",
"SeparableConv2d-5 [-1, 128, 20, 20] [-1, 256, 20, 20] 0\n",
" BatchNorm2d-4 [-1, 256, 20, 20] [-1, 256, 20, 20] 1,024\n",
" Conv2d-14 [-1, 256, 20, 20] [-1, 256, 20, 20] 2,304\n",
" Conv2d-15 [-1, 256, 20, 20] [-1, 256, 20, 20] 65,792\n",
"SeparableConv2d-6 [-1, 256, 20, 20] [-1, 256, 20, 20] 0\n",
" MaxPool2d-3 [-1, 256, 20, 20] [-1, 256, 10, 10] 0\n",
" Conv2d-16 [-1, 128, 20, 20] [-1, 256, 10, 10] 33,024\n",
" Encoder-3 [-1, 128, 20, 20] [-1, 256, 10, 10] 0\n",
" ReLU-8 [-1, 32, 80, 80] [-1, 32, 80, 80] 0\n",
"ConvTranspose2d-7 [-1, 64, 80, 80] [-1, 32, 80, 80] 18,464\n",
" BatchNorm2d-8 [-1, 32, 80, 80] [-1, 32, 80, 80] 128\n",
"ConvTranspose2d-8 [-1, 32, 80, 80] [-1, 32, 80, 80] 9,248\n",
" Upsample-4 [-1, 64, 80, 80] [-1, 64, 160, 160] 0\n",
" Conv2d-20 [-1, 64, 160, 160] [-1, 32, 160, 160] 2,080\n",
" Decoder-4 [-1, 64, 80, 80] [-1, 32, 160, 160] 0\n",
" Conv2d-21 [-1, 32, 160, 160] [-1, 4, 160, 160] 1,156\n",
"================================================================================\n",
"Total params: 168,420\n",
"Trainable params: 167,140\n",
......@@ -784,7 +784,7 @@
"{'total_params': 168420, 'trainable_params': 167140}"
]
},
"execution_count": 31,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
......@@ -822,7 +822,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 11,
"metadata": {
"colab": {},
"colab_type": "code",
......@@ -850,7 +850,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 12,
"metadata": {
"colab": {},
"colab_type": "code",
......@@ -903,7 +903,7 @@
" epsilon=1e-07, \n",
" centered=False,\n",
" parameters=model.parameters())\n",
"model = paddle.Model(PetModel(num_classes))\n",
"model = paddle.Model(PetNet(num_classes))\n",
"model.prepare(optim, SoftmaxWithCrossEntropy())\n",
"model.fit(train_dataset, \n",
" val_dataset, \n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册