随笔分类 -  NLP通经脉

记录一下一些NLP的概念
摘要:参考文章: https://blog.csdn.net/tailonh/article/details/120544719 正如上文所说,原因之一在于: 1、首先要除以一个数,防止输入softmax的值过大,导致偏导数趋近于0; 2、选择根号d_k是因为可以使得q*k的结果满足期望为0,方差为1的分 阅读全文
posted @ 2022-09-20 08:40 Hisi 阅读(4860) 评论(0) 推荐(0) 编辑
摘要:可以参考这篇文章: Maxout激活函数原理及实现 - 简书 (jianshu.com) 其中文章中的这张图片是精华. 另外我觉得还可以这样子理解: 也就是说,从左到右做线性层运算,然后堆叠起来,在列方向取最大值作为max out的输出。(画的有点丑つ﹏⊂) 阅读全文
posted @ 2022-09-18 09:16 Hisi 阅读(338) 评论(0) 推荐(0) 编辑
摘要:The McCulloch-Pitts Neuron (McCulloch and Pitts, 1943) was an early model of brain function. This linear model could recognize two different categorie 阅读全文
posted @ 2022-09-14 17:25 Hisi 阅读(179) 评论(0) 推荐(0) 编辑
摘要:其实很简单,求出线性回归表达式的解析解就好了,还不需要使用梯度下降法。 方法如下: 假设损失函数为(推导提示看文末图): $J(θ) = \frac{1}{2}\sum_{i=1}^n(h_θ(x^{(i)}-y^{(i)})^2=\frac{1}{2}(X\theta-Y)^T(X\theta-Y 阅读全文
posted @ 2022-09-12 23:03 Hisi 阅读(138) 评论(0) 推荐(0) 编辑
摘要:原文链接:【link】(以下的截图和部分文字均取自上链接) self-attention中存在的问题 一个序列中,第i个单词和第j个单词的attention score分数为: 其中Wq,Wk分别是multi-head attention给每个head加的query和key参数,Exi和Exj是xi 阅读全文
posted @ 2022-08-23 17:49 Hisi 阅读(130) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2022-08-21 10:11 Hisi 阅读(6) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/qq_30122359/article/details/102955570 阅读全文
posted @ 2022-08-16 10:52 Hisi 阅读(27) 评论(0) 推荐(0) 编辑
摘要:目录: https://cloud.tencent.com/developer/article/1137500 K-means算法: https://zhuanlan.zhihu.com/p/78798251 K-means++算法: 1. https://zhuanlan.zhihu.com/p/ 阅读全文
posted @ 2022-08-03 17:55 Hisi 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-07-31 10:33 Hisi 阅读(93) 评论(0) 推荐(0) 编辑
摘要:假设我有如下三维tensor: matrix = torch.tensor([ [ [1,2,3], [4,5,6] ], [ [2,3,4], [5,6,7] ] ]) 索引方法为: matrix[ [ [0], [1] ], [ [0,1], [1,1] ], [ [2,1], [1,2] ] 阅读全文
posted @ 2022-07-13 10:23 Hisi 阅读(50) 评论(0) 推荐(0) 编辑
摘要:一句话:我设定一些特征函数,就是一些规则(见第一篇链接),然后优化模型,使得实际解在这些规则下成为最优解的可能性最大,其余所有的可能解的成为模型给出的解的可能性最小。HMM模型是一种CRF,也就是说,如果CRF的特征函数设定为HMM假设(https://zhuanlan.zhihu.com/p/70 阅读全文
posted @ 2022-07-12 21:38 Hisi 阅读(89) 评论(0) 推荐(0) 编辑
摘要:https://medium.com/nlplanet/two-minutes-nlp-quick-intro-to-question-answering-124a0930577c 阅读全文
posted @ 2022-07-12 20:55 Hisi 阅读(13) 评论(0) 推荐(0) 编辑
摘要:随着接触到的模型越来越大,自然就会接触到这种技术。 记录下自己的踩坑过程,当看到多机多卡跑通后,那种苦尽甘来的感觉还是挺舒服的。 我们首先来说一下单机多卡 huggingface上面有大佬上传了中文的BigBird的权重,想尝试能够处理的序列最长长度为4096的模型,但是放到单张卡里面batch_s 阅读全文
posted @ 2022-05-18 17:56 Hisi 阅读(2563) 评论(0) 推荐(0) 编辑
摘要:https://huggingface.co/blog/big-bird#bigbird-block-sparse-attention 阅读全文
posted @ 2022-05-09 13:44 Hisi 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-05-03 15:59 Hisi 阅读(10) 评论(0) 推荐(0) 编辑
摘要:第一次使用BERT时,发现如果我的输入是[1,512]的形状的 (512个token的index),那么输入就会是[1,512,768],这个时候就麻了,为啥会有512个768呀,虽然说我有512个输入,但是为啥BERT要输出512个768呢,原因目前还不清楚,不过现在知道了第一个768(outpu 阅读全文
posted @ 2022-04-19 18:17 Hisi 阅读(416) 评论(0) 推荐(0) 编辑
摘要:Token embeddings: A [CLS] token is added to the input word tokens at the beginning of the first sentence and a [SEP] token is inserted at the end of e 阅读全文
posted @ 2022-04-19 17:45 Hisi 阅读(879) 评论(0) 推荐(0) 编辑
摘要:最近在学习英语的时候,刚好发现了这个新知识,立马记下来哈哈哈哈。 Pre-trained language representations can either be context-free or context-based. Context-based representations can t 阅读全文
posted @ 2022-04-19 17:31 Hisi 阅读(123) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示