Skip to content

Commit 400e7da

Browse files
Feat: Implement Multi Layer Perceptron from scratch.
Changes to be committed: modified: LogisticRegressionGluon.ipynb new file: MLPScratch.ipynb
1 parent b95eb82 commit 400e7da

File tree

2 files changed

+254
-14
lines changed

2 files changed

+254
-14
lines changed

LogisticRegressionGluon.ipynb

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 8,
5+
"execution_count": 1,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -14,7 +14,7 @@
1414
},
1515
{
1616
"cell_type": "code",
17-
"execution_count": 4,
17+
"execution_count": 2,
1818
"metadata": {},
1919
"outputs": [],
2020
"source": [
@@ -33,7 +33,7 @@
3333
},
3434
{
3535
"cell_type": "code",
36-
"execution_count": 12,
36+
"execution_count": 3,
3737
"metadata": {},
3838
"outputs": [],
3939
"source": [
@@ -45,7 +45,7 @@
4545
},
4646
{
4747
"cell_type": "code",
48-
"execution_count": 19,
48+
"execution_count": 4,
4949
"metadata": {},
5050
"outputs": [],
5151
"source": [
@@ -62,7 +62,7 @@
6262
},
6363
{
6464
"cell_type": "code",
65-
"execution_count": 20,
65+
"execution_count": 5,
6666
"metadata": {},
6767
"outputs": [],
6868
"source": [
@@ -73,7 +73,7 @@
7373
},
7474
{
7575
"cell_type": "code",
76-
"execution_count": 21,
76+
"execution_count": 6,
7777
"metadata": {},
7878
"outputs": [],
7979
"source": [
@@ -84,7 +84,7 @@
8484
},
8585
{
8686
"cell_type": "code",
87-
"execution_count": 22,
87+
"execution_count": 7,
8888
"metadata": {},
8989
"outputs": [],
9090
"source": [
@@ -94,23 +94,28 @@
9494
},
9595
{
9696
"cell_type": "code",
97-
"execution_count": 23,
97+
"execution_count": 9,
9898
"metadata": {},
9999
"outputs": [
100100
{
101101
"name": "stdout",
102102
"output_type": "stream",
103103
"text": [
104-
"Epoch 0, acc: 0.805600\n",
105-
"Epoch 1, acc: 0.822417\n",
106-
"Epoch 2, acc: 0.826817\n",
107-
"Epoch 3, acc: 0.831850\n",
108-
"Epoch 4, acc: 0.838033\n"
104+
"Epoch 0, acc: 0.841133\n",
105+
"Epoch 1, acc: 0.844767\n",
106+
"Epoch 2, acc: 0.844800\n",
107+
"Epoch 3, acc: 0.847500\n",
108+
"Epoch 4, acc: 0.849050\n",
109+
"Epoch 5, acc: 0.849267\n",
110+
"Epoch 6, acc: 0.848650\n",
111+
"Epoch 7, acc: 0.849333\n",
112+
"Epoch 8, acc: 0.852783\n",
113+
"Epoch 9, acc: 0.854133\n"
109114
]
110115
}
111116
],
112117
"source": [
113-
"epochs = 5\n",
118+
"epochs = 10\n",
114119
"for epoch in range(epochs):\n",
115120
" for X, y in train_iter:\n",
116121
" with autograd.record():\n",

0 commit comments

Comments
 (0)