Theano 逻辑回归教程 的注释

来源:互联网 发布:sqlserver history 编辑:程序博客网 时间:2024/05/16 17:19

http://deeplearning.net/tutorial/logreg.html
教程的目的是用逻辑回归分类0-9的手写图像

self.W = theano.shared(            value=numpy.zeros(                (n_in, n_out),#784*10,还是二维的,可见28×28的图像,还是转成784的vector                dtype=theano.config.floatX            ),            name='W',            borrow=True        )
self.p_y_given_x = T.nnet.softmax(T.dot(input, self.W) + self.b)self.y_pred = T.argmax(self.p_y_given_x, axis=1)#上一句的softmax加上这里的argmax,可以想到,如果训练好了W和b,那#么对于任意的数字0-9的图像之一输入,最有可能的将造成softmax对应的#结果最大,至于W和b的训练,参考http://blog.csdn.net/guotong1988/article/details/50543339 #至于softmax是什么参考https://www.zhihu.com/question/23765351
0 0
原创粉丝点击