Skip to content

Commit

Permalink
Feat: Implement Dropout in Gluon
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   DropOutScratch.ipynb
	new file:   DropoutGluon.ipynb
  • Loading branch information
dheeraj-coding committed Aug 15, 2019
1 parent 2333aa5 commit 3ce85e5
Show file tree
Hide file tree
Showing 2 changed files with 197 additions and 9 deletions.
23 changes: 14 additions & 9 deletions DropOutScratch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 33,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -152,30 +152,35 @@
"num_inputs = 28*28\n",
"num_hidden1, num_hidden2 = 256, 256\n",
"num_output = 10\n",
"drop_probs = [0.0, 0.0]\n",
"drop_probs = [0.2, 0.5]\n",
"\n",
"params = init_params(num_inputs, num_hidden1, num_hidden2, num_output)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 35,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch 0, acc: 0.798250 loss: 0.545852\n",
"Epoch 1, acc: 0.827333 loss: 0.483884\n",
"Epoch 2, acc: 0.840633 loss: 0.448361\n",
"Epoch 3, acc: 0.854817 loss: 0.406807\n",
"Epoch 4, acc: 0.861367 loss: 0.389544\n"
"Epoch 0, acc: 0.843933 loss: 0.449781\n",
"Epoch 1, acc: 0.849133 loss: 0.423806\n",
"Epoch 2, acc: 0.853700 loss: 0.407548\n",
"Epoch 3, acc: 0.857400 loss: 0.393078\n",
"Epoch 4, acc: 0.865700 loss: 0.377074\n",
"Epoch 5, acc: 0.869967 loss: 0.364002\n",
"Epoch 6, acc: 0.872833 loss: 0.356155\n",
"Epoch 7, acc: 0.871917 loss: 0.355115\n",
"Epoch 8, acc: 0.874833 loss: 0.346407\n",
"Epoch 9, acc: 0.881317 loss: 0.328503\n"
]
}
],
"source": [
"epochs = 5\n",
"epochs = 10\n",
"lr = 0.1\n",
"loss = gluon.loss.SoftmaxCrossEntropyLoss()\n",
"for epoch in range(epochs):\n",
Expand Down
Loading

0 comments on commit 3ce85e5

Please sign in to comment.