上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: 网址链接:https://algorithms.tutorialhorizon.com/dynamic-programming-edit-distance-problem/ 1. 目标:给定两个字符串s1, s2,写出一个算法来找出从s1转化到s2所需要的最小操作步骤数(编辑距离)。 所允许的操作: 阅读全文
posted @ 2020-01-02 22:14 RamboBai 阅读(712) 评论(0) 推荐(0) 编辑
摘要: 当模型有多输出的时候,容易产生此问题,如以下程序所示: # zero the parameter gradients model.zero_grad() # forward + backward + optimize outputs, hidden = model(inputs, hidden) l 阅读全文
posted @ 2019-11-29 18:31 RamboBai 阅读(8234) 评论(0) 推荐(0) 编辑
摘要: 本文参考自:https://github.com/apachecn/AiLearning/blob/master/src/py2.x/ml/13.PCA/pca.py https://github.com/lawlite19/MachineLearning_Python#%E5%85%ADpca%E 阅读全文
posted @ 2019-11-11 09:08 RamboBai 阅读(3959) 评论(1) 推荐(0) 编辑
摘要: 1.多输入通道 当输入数据含多个通道时,我们需要构造一个输入通道数与输入数据的通道数相同的卷积核。以1维卷积为例,卷积窗口大小为1*1,输入有三个通道,所以卷积的通道数也应该为3个通道。如下图所示,输入的数据有三个通道,卷积也有三个通道,每个通道都是一个1维的卷积核且卷积核的大小为1​1, 但是这样 阅读全文
posted @ 2019-11-09 20:45 RamboBai 阅读(4330) 评论(0) 推荐(0) 编辑
摘要: 本文参考自:(1)李航《统计学习与方法》 (2)https://github.com/apachecn/AiLearning/blob/master/src/py2.x/ml/7.AdaBoost/adaboost.py 提升方法(boosting)是一种常用的统计学习方法,在分类问题中,他通过改变 阅读全文
posted @ 2019-11-08 16:18 RamboBai 阅读(7251) 评论(2) 推荐(2) 编辑
摘要: 本文转载自:https://github.com/apachecn/AiLearning/blob/e6ddd161f89f42d45fcee483b2292a8c7b2a9638/src/py2.x/ml/7.RandomForest/randomForest.py#L136 from rando 阅读全文
posted @ 2019-11-07 16:29 RamboBai 阅读(8981) 评论(2) 推荐(0) 编辑
摘要: 转载自:https://github.com/apachecn/AiLearning/blob/master/docs/ml/4.%E6%9C%B4%E7%B4%A0%E8%B4%9D%E5%8F%B6%E6%96%AF.md 应用贝叶斯准则: 使用上面这些定义,可以定义贝叶斯分类准则为: 如果 P 阅读全文
posted @ 2019-11-05 14:11 RamboBai 阅读(1238) 评论(0) 推荐(0) 编辑
摘要: 本文参考自:https://www.jianshu.com/p/154ee3354b59 和 李航博士的《统计学习方法》 1. 2. 创建观测结果数据 输出一下,观察一下结果: 结果: matrix([[0., 0., 1., 1., 1., 1., 0., 1., 0., 1.]]) 3. EM算 阅读全文
posted @ 2019-11-04 10:39 RamboBai 阅读(2549) 评论(0) 推荐(1) 编辑
摘要: 本代码参考自: https://github.com/lawlite19/MachineLearning_Python/blob/master/K-Means/K-Menas.py 1. 初始化类中心,从样本中随机选取K个点作为初始的聚类中心点 2. 找出每个样本离哪一个类中心的距离最近,并返回 3 阅读全文
posted @ 2019-11-02 13:38 RamboBai 阅读(3690) 评论(0) 推荐(0) 编辑
摘要: 本代码来源自:https://github.com/Erikfather/Decision_tree-python 1.数据集描述 为了方便,我对数据集进行如下处理: 在编写代码之前,我们先对数据集进行属性标注。 (0)年龄:0代表青年,1代表中年,2代表老年; (1)有工作:0代表否,1代表是; 阅读全文
posted @ 2019-10-31 16:39 RamboBai 阅读(4098) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页