Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Symb1OS committed Jul 6, 2018
1 parent 419822b commit 201ba37
Showing 1 changed file with 52 additions and 12 deletions.
64 changes: 52 additions & 12 deletions notebook/Parse.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -26,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -90,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -99,7 +99,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -172,7 +172,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -239,7 +239,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -284,31 +284,71 @@
")"
]
},
"execution_count": 18,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"model = Parser()\n",
"model = Parser().cuda()\n",
"model"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"criterion = nn.CrossEntropyLoss()\n",
"optimizer = torch.optim.Adam(model.parameters(), lr=1e-5, weight_decay=1e-5)"
"optimizer = torch.optim.Adam(model.parameters(), lr=1e-3, weight_decay=1e-5)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 14,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/user/miniconda/envs/py36/lib/python3.6/site-packages/ipykernel_launcher.py:28: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number\n",
"/home/user/miniconda/envs/py36/lib/python3.6/site-packages/ipykernel_launcher.py:26: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"100 : 1200, Loss= 5.223594665527344, Acc:0.05000000000000001, TestAcc: 0.04406779661016943\n",
"200 : 1200, Loss= 3.02164363861084, Acc:0.179, TestAcc: 0.17415254237288164\n",
"300 : 1200, Loss= 2.3282227516174316, Acc:0.3800000000000001, TestAcc: 0.6326271186440676\n",
"400 : 1200, Loss= 3.2919750213623047, Acc:0.595, TestAcc: 0.7771186440677975\n",
"500 : 1200, Loss= 2.8729798793792725, Acc:0.696, TestAcc: 0.7504237288135599\n",
"600 : 1200, Loss= 2.440894603729248, Acc:0.7410000000000001, TestAcc: 0.7343220338983049\n",
"700 : 1200, Loss= 1.0605435371398926, Acc:0.7920000000000001, TestAcc: 0.8923728813559342\n",
"800 : 1200, Loss= 1.2861864566802979, Acc:0.8150000000000003, TestAcc: 0.8559322033898322\n",
"900 : 1200, Loss= 0.5938747525215149, Acc:0.8360000000000004, TestAcc: 0.9377118644067811\n",
"1000 : 1200, Loss= 0.3396875560283661, Acc:0.8459999999999998, TestAcc: 0.9038135593220359\n",
"1100 : 1200, Loss= 0.27643871307373047, Acc:0.8549999999999999, TestAcc: 0.8525423728813579\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/user/miniconda/envs/py36/lib/python3.6/site-packages/ipykernel_launcher.py:33: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch: 0, Loss:2.255427360534668, Acc:0.637499999999996, TestAcc: 0.9559322033898316\n"
]
}
],
"source": [
"model.train()\n",
"\n",
Expand Down

0 comments on commit 201ba37

Please sign in to comment.