Commit f5840f08 by 20200203098

Replace problem1.ipynb

parent 08d9d6c0
...@@ -88,17 +88,78 @@ ...@@ -88,17 +88,78 @@
] ]
}, },
{ {
"cell_type": "code", "cell_type": "markdown",
"execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "source": [
"source": [] "$L(w)=\\sum_{i}^{m}{y_{i}^{}log\\tilde{y}}+(1-y_{i})log(1-\\tilde{y}),\\tilde{y}=\\frac{1}{1-e_{}^{-(wx+b)}}$"
]
}, },
{ {
"cell_type": "code", "cell_type": "markdown",
"execution_count": null, "metadata": {},
"source": [
" "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$\\frac{\\partial L}{\\partial w}=\\sum_{i}^{n}{(A_{i}^{}-y_{i}^{})*x_{i}^{}},A=\\frac{1}{1-e^{-(wx+b)}}$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
">用向量表示即 $\\frac{\\partial L}{\\partial w}=X*(A-Y)^{T}$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$\\frac{\\partial^{2}L}{\\partial^{2}w}=\\sum_{i}^{n}\\frac{x_{ij}x_{ik}e^{-(wX_{i}+b)}}{A^{2}}=\\sum_{i}^{n}x_{ij}x_{ik}A_{i}(1-A_{i})$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$H=\\left(\n",
" \\begin{array}{ccc}\n",
" x_{11}& ……&…… & x_{1n} \\\\\n",
" …… &&&…… \\\\\n",
" …… & &&…… \\\\\n",
"x_{n1} &……&…… &x_{nn}\n",
" \\end{array}\n",
"\\right)*\\left(\n",
" \\begin{array}{ccc}\n",
" A_{1}(1-A_{1})& …… & …… & 0 \\\\\n",
" 0 &A_{2}(1-A_{2})&& \\\\\n",
" …… & &……& \\\\\n",
"0 &……&…… &A_{2}(1-A_{2})\\\\\n",
" \\end{array}\n",
"\\right)*\\left(\n",
" \\begin{array}{ccc}\n",
" x_{11}& ……&…… & x_{n1} \\\\\n",
" …… &&&…… \\\\\n",
" …… &&&…… \\\\\n",
"x_{1n} &……&…… &x_{nn}\n",
" \\end{array}\n",
"\\right)=X^{T}*V*X$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
">由于V中对角线上的值>0,因此矩阵H>=0,故逻辑回归函数的损失函数为凸函数"
]
},
{
"cell_type": "markdown",
"metadata": {}, "metadata": {},
"outputs": [],
"source": [] "source": []
}, },
{ {
...@@ -125,7 +186,7 @@ ...@@ -125,7 +186,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.7.1" "version": "3.7.3"
} }
}, },
"nbformat": 4, "nbformat": 4,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment