資源簡介
使用邏輯回歸進行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
評論
共有 條評論