![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
AI
机器学习与深度学习
wuxtwu
这个作者很懒,什么都没留下…
展开
-
关于过拟合
这篇博客总结的还可以:https://blog.csdn.net/heyongluoyao8/article/details/49429629来自知乎:https://www.zhihu.com/question/59201590转载 2019-05-30 11:27:10 · 212 阅读 · 0 评论 -
关于param,模型的加载等
模型加载https://discuss.pytorch.org/t/how-to-load-part-of-pre-trained-model/1113/8param 学习率https://discuss.pytorch.org/t/how-to-perform-finetuning-in-pytorch/419/6https://discuss.pytorch.org/t/how-c...转载 2019-05-30 11:34:00 · 236 阅读 · 0 评论 -
调整学习率
来自这篇博客:http://www.spytensor.com/index.php/archives/32/?qmzqne=euz3w&aotqba=q4jls转载 2019-05-30 11:29:01 · 489 阅读 · 0 评论 -
DAC 复现笔记
关于复制有的时候,如果只是去tensor中的数据,可以直接用tensor.data除此之外,复制还有clone(),但此时,会将求导状态也复制下来,此时,需要detach()https://discuss.pytorch.org/t/clone-and-detach-in-v0-4-0/16861https://zhuanlan.zhihu.com/p/38475183损失函数的多个输...原创 2019-05-30 11:14:55 · 157 阅读 · 0 评论 -
Pytorch DataLoder中sampler
先看下官方给出的sampler.py源码:https://github.com/pytorch/pytorch/blob/master/torch/utils/data/sampler.py#L73-L90import torchfrom torch._six import int_classes as _int_classesclass Sampler(object): r"...原创 2019-05-04 20:41:44 · 17978 阅读 · 0 评论 -
Kaggel-Titantic笔记
pandas.get_dummies() : one-hot 编码https://blog.csdn.net/u010665216/article/details/78635664对某一列数据统计 train[‘Survived’].value_counts()sns.countplot 离散,有 hue 选项t.groupby(’…’)[’…’].mean(...原创 2019-05-04 20:37:26 · 180 阅读 · 0 评论 -
集成学习
--------------待更新--------------Mark一些学习资料:https://github.com/imhuay/Algorithm_Interview_Notes-Chinese/blob/master/A-机器学习/A-机器学习算法.md#梯度提升决策树-gbdt (一个简练的总结)http://www.cnblogs.com/pinard/p/6131423....原创 2019-05-04 20:36:01 · 68 阅读 · 0 评论 -
《机器学习实战》--LR
LR公式推导:https://blog.csdn.net/Dinosoft/article/details/34960693 损失函数和最小二乘相近。 最大似然和最小化损失函数相近应该属于二项分布的广义线性模型:http://www.huaxiaozhuan.com/统计学习/chapters/1_linear.html原始课件:http://cs229.stanford.edu/n...原创 2019-04-07 15:51:23 · 163 阅读 · 0 评论 -
《机器学习实战》---朴素贝叶斯分类器进行文本分类
朴素贝叶斯分类器:假设特征之间相互独立另外,有两种模式 词集set(一个词在文档中只出现一次,即词向量中每个词的权重相等),伯努利模型;词袋bag,多项式模型code:https://github.com/apachecn/AiLearning/blob/master/src/py2.x/ml/4.NaiveBayes/bayes.pyimport numpy as npdef load...原创 2019-04-03 23:42:26 · 348 阅读 · 0 评论 -
决策树(ID3)
import numpy as npfrom collections import *from math import logdef createDataset(): dataSet = [ [1, 1, 'yes'], [1, 1, 'yes'], [1, 0, 'no'], [0, 1, 'no'], [0, ...转载 2019-05-04 20:38:57 · 100 阅读 · 0 评论 -
《机器学习实战》-- KNN
import collectionsimport numpy as npimport matplotlibimport matplotlib.pyplot as pltdef file2matrix(filename): """ :param filename: 数据文件路径 :return: 数据矩阵和对应的类别 """ fr = open...转载 2019-05-04 20:39:45 · 68 阅读 · 0 评论 -
深度学习点滴记录
参数量和FLOPS的计算:参数量和计算量的计算方式也不太相同,计算量需要在参数量的基础上,乘以输入feature map的H和W,以及输出feature map的H’ 和W‘。caffe中,depthwise conv未必比普通卷积快:https://www.zhihu.com/question/265434464https://www.zhihu.com/question/2...原创 2019-04-01 17:59:28 · 120 阅读 · 0 评论 -
关于GlobalPool
参考自:https://stats.stackexchange.com/questions/257321/what-is-global-max-pooling-layer-and-what-is-its-advantage-over-maxpooling-layer总的来说,globalpool 相当于将kernel的尺寸设置为了和input size相同,因此,经过GlobalPool,...原创 2019-03-19 20:55:01 · 1064 阅读 · 0 评论 -
为何对数据进行“中心化、归一化”处理
来自知乎回答:https://www.zhihu.com/question/370694771、神经网络中,将原始数据进行去中心、归一化这样的标准化处理,(归一化)使得不同的特征具有相同的尺度(量纲),即消除特征之间的差异性,在使用梯度下降法学习参数的时候,不同特征对参数的影响程度就一样了,(一心一意学习权重)从而加速神经网络的训练。(去中心化)增加基向量的正交性。2、使用PCA时,一般只...原创 2019-02-15 10:32:49 · 4120 阅读 · 1 评论 -
面试(SVM)
SVM 推导为什么转换为对偶问题写下KKT条件核函数:线性核函数,非线性核函数,区别,各自的用途SVM 对异常点敏感 不 ? 如何解决这个问题?原创 2019-01-20 22:18:32 · 400 阅读 · 0 评论 -
安装warp-ctc的问题、DataParallel的问题
基本和这篇博客说的一样:https://blog.csdn.net/yuanlulu/article/details/85462997pytorch 0.4.1的地址在:https://github.com/SeanNaren/warp-ctc/releases/tag/0.4.1下载源代码,解压即可。然后还要 pip install cffi 的包用 Dataparallel的话,...原创 2019-01-25 22:48:36 · 889 阅读 · 0 评论 -
pytorh两个向量距离的平方(center loss)
即 center-loss:https://github.com/KaiyangZhou/pytorch-center-loss/blob/master/center_loss.pydef forward(self, x, labels): """ Args: x: feature matrix with shape (batch_siz...原创 2018-12-29 20:52:18 · 2404 阅读 · 0 评论 -
Softmax和Cross Entropy Loss
https://deepnotes.io/softmax-crossentropy转载 2018-12-24 00:47:57 · 119 阅读 · 0 评论 -
为何使用交叉熵作为损失函数?
以下图片来自:https://www.zhihu.com/question/41252833(Noriko Oshima 的回答)即用一个概率分布,去尽可能的估计真实数据分布,“使用错误分布q来表示来自真实分布p的平均编码长度”,这个长度大于等于真实分布编码的长度。因此,交叉熵越小越好。相对熵是错误编码长度和真实编码长度的差值,也即KL散度。还有一篇博客来自:http://shu...转载 2018-12-24 00:44:15 · 838 阅读 · 0 评论 -
Logistic Regression
https://tech.meituan.com/intro_to_logistic_regression.htmlhttps://chenrudan.github.io/blog/2016/01/09/logisticregression.htmlhttps://blog.csdn.net/aliceyangxi1987/article/details/80532586转载 2018-12-24 00:56:31 · 98 阅读 · 0 评论 -
关于全连接层 fully connect
看到过别人在加载模型的时候,会有丢掉后面的fully connect层的做法。总结下fully conncet 的解释和用法:这是网上的一种解释:https://stats.stackexchange.com/questions/182102/what-do-the-fully-connected-layers-do-in-cnns...原创 2018-12-10 22:14:16 · 1376 阅读 · 0 评论 -
Navie Bayes Classification
【转】http://www.cnblogs.com/leoo2sk/archive/2010/09/17/naive-bayesian-classifier.html 算法杂货铺——分类算法之朴素贝叶斯分类(Naive Bayesian classification) 2010-09-17 13:09 by T2噬菌体,...转载 2018-12-11 20:15:16 · 181 阅读 · 0 评论 -
PCA与SVD的区别和联系
因为之前在做PCA的时候,就直接用的SVD求解,以为SVD属于PCA的一部分,看了一下两篇博文,有一定收获。注意,左奇异向量和右奇异向量是针对数据X而言的:注意到协方差矩阵的特点:实对称,且大小为 D * D,D为数据X的维度。因此,当X每一行为一个样本,对应协方差矩阵为,X.T * X,需要求左奇异向量U,并且取其前k个,则压缩后的单个样本为Uk.T*X反之,求右奇异向量。PCA:从最...原创 2018-12-12 21:30:16 · 1950 阅读 · 0 评论 -
K-means实践作业记录
Broadcastinghttps://docs.scipy.org/doc/numpy-1.13.0/user/basics.broadcasting.htmlnumpy.argmaxhttps://docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.argmax.htmlnumpy.apply_along_axishtt...原创 2018-12-18 01:28:42 · 155 阅读 · 0 评论 -
广义线性模型
定义:统计学上, 广义线性模型 (Generalized linear model) 是一种应用灵活的线性回归模型,简称GLM。该模型允许因变量的偏差分布有除了正态分布之外的其它分布。---- [ 维基百科 ]即,线性回归因变量y服从高斯分布,LR因变量y服从二项分布;二者均可从极大似然估计的角度建模。《PRML》:待更新……...原创 2018-12-19 23:52:44 · 441 阅读 · 0 评论 -
Showing ValueError: shapes (1,3) and (1,3) not aligned: 3 (dim 1) != 1 (dim 0)
在使用 numpy重点矩阵 和 array数组相乘的时候,经常会发生这个错误,解决方法可以进行一定的转换:其实我觉得一般不必要把list转为mat,还不如直接转为array....原创 2019-04-07 14:27:57 · 14469 阅读 · 0 评论 -
caffe 添加新层
参考: https://blog.csdn.net/u012426298/article/details/81016600optional float xx = 1 default [1] (好像只能初始化为1)原创 2019-03-26 14:16:48 · 320 阅读 · 0 评论 -
win10遍历文件夹
代码参考:https://blog.csdn.net/lhanchao/article/details/53576311#include <io.h>//所需头文件#include <iostream>#include <string>using namespace std;void getAllFileNames(const string&am...原创 2019-03-18 19:35:47 · 419 阅读 · 0 评论 -
numpy repeat 和 torch repeat
#两者不同……原创 2018-12-10 11:06:14 · 2499 阅读 · 3 评论 -
TADAM: Task dependent adaptive metric for improved few-shot learning
文章的主要贡献metric scaling 在将距离d输入到softmax层之前,乘以一个系数α\alphaα,这样使得余弦和欧式距离区分度不那么明显,也使得模型的适应性更强;文中将α\alphaα分为两种情况讨论:即α→0\alpha\to0α→0 和α→∞\alpha\to\inftyα→∞,从文中公式(3)(4)可以看出,两种情况的第一项作用相同,都是最小化query 到其相应类别的...原创 2018-12-17 17:00:57 · 612 阅读 · 0 评论 -
Learning Embedding Adaptation for Few-Shot Learning
Abstractby learning an instance embedding function from seen classes, and apply the function to instances from unseen classes with limited labels.usually learn a discriminative instance embedding m...原创 2020-05-05 12:02:10 · 614 阅读 · 1 评论 -
Learning Embedding Adaptation for Few-Shot Learning---- 论文阅读笔记
Abstract之前的方法:is task-agnostic: the embedding function is not learned optimally discriminative with respect to the unseen classes, where discerning among them is the target task.改进的地方:to adapt the ...翻译 2019-05-09 15:43:28 · 1802 阅读 · 8 评论