资源简介
使用逻辑回归进行MNIST手写字符识别的代码,PYTHON语言。
代码片段和文件信息
“““
This tutorial introduces logistic regression using Theano and stochastic
gradient descent.
Logistic regression is a probabilistic linear classifier. It is parametrized
by a weight matrix :math:‘W‘ and a bias vector :math:‘b‘. Classification is
done by projecting data points onto a set of hyperplanes the distance to
which is used to determine a class membership probability.
Mathematically this can be written as:
.. math::
P(Y=i|x Wb) &= softmax_i(W x + b) \\
&= \frac {e^{W_i x + b_i}} {\sum_j e^{W_j x + b_j}}
The output of the model or prediction is then done by taking the argmax of
the vector whose i‘th element is P(Y=i|x).
.. math::
y_{pred} = argmax_i P(Y=i|xWb)
This tutorial presents a stochastic gradient descent optimization method
suitable for l
评论
共有 条评论