lecture 3,Loss Function and Optimization

来源:互联网 发布:高分一号数据在哪下载 编辑:程序博客网 时间:2024/06/06 00:46

1,处理指数计算问题时,为了防止overflow 的处理方法(我还是存在疑问,这相当与求超级大的数的导数):

f = np.array([123, 456, 789]) # example with 3 classes and each having large scoresp = np.exp(f) / np.sum(np.exp(f)) # Bad: Numeric problem, potential blowup# instead: first shift the values of f so that the highest number is 0:f -= np.max(f) # f becomes [-666, -333, 0] p = np.exp(f) / np.sum(np.exp(f)) # safe to do, gives the correct answer

2,关于LR为凸函数,可以保证最值(中科大面试时被问到)???

3,svm的代码复现,看了很多遍svm的思路,也被面试问到过svm,不如尝试复现一次或者trvarse吧。。。

原创粉丝点击