logistic_regression.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:DeepLearning 作者: corecai163 项目源码 文件源码
def logreg(hdf5, batch_size):
    # logistic regression: data, matrix multiplication, and 2-class softmax loss
    n=caffe.NetSpec()
    n.data,n.label = L.HDF5Data(batch_size=batch_size,source=hdf5,ntop=2)
    n.ip1 = L.InnerProduct(n.data,num_output=2,weight_filler=dict(type='xavier'))
    n.accuracy = L.Accuracy(n.ip1,n.label)
    n.loss = L.SoftmaxWithLoss(n.ip1,n.label)
    return n.to_proto()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号