forked from pms/uczenie-maszynowe
Wykład 12
This commit is contained in:
parent
772450120e
commit
c554dac58f
@ -260,8 +260,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"source": [
|
"source": [
|
||||||
"$$ f(x_1, x_2) = \\max(x_1 + x_2) \\hskip{12em} \\\\\n",
|
"$$ f(x_1, x_2) = \\max(x_1, x_2) \\hskip{12em} \\\\\n",
|
||||||
"\\to \\qquad \\frac{\\partial f}{\\partial x_1} = \\mathbb{1}_{x \\geq y}, \\quad \\frac{\\partial f}{\\partial x_2} = \\mathbb{1}_{y \\geq x}, \\quad \\nabla f = (\\mathbb{1}_{x \\geq y}, \\mathbb{1}_{y \\geq x}) $$ "
|
"\\to \\qquad \\frac{\\partial f}{\\partial x_1} = \\mathbb{1}_{x_1 \\geq x_2}, \\quad \\frac{\\partial f}{\\partial x_2} = \\mathbb{1}_{x_2 \\geq x_1}, \\quad \\nabla f = (\\mathbb{1}_{x_1 \\geq x_2}, \\mathbb{1}_{x_2 \\geq x_1}) $$ "
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1085,9 +1085,9 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"model = keras.Sequential()\n",
|
"model = keras.Sequential()\n",
|
||||||
"model.add(Dense(512, activation=\"relu\", input_shape=(784,)))\n",
|
"model.add(Dense(512, activation=\"relu\", input_shape=(784,)))\n",
|
||||||
"# model.add(Dropout(0.2))\n",
|
"model.add(Dropout(0.2))\n",
|
||||||
"model.add(Dense(512, activation=\"relu\"))\n",
|
"model.add(Dense(512, activation=\"relu\"))\n",
|
||||||
"# model.add(Dropout(0.2))\n",
|
"model.add(Dropout(0.2))\n",
|
||||||
"model.add(Dense(num_classes, activation=\"softmax\"))\n",
|
"model.add(Dense(num_classes, activation=\"softmax\"))\n",
|
||||||
"model.summary()"
|
"model.summary()"
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user