![](https://img-blog.csdnimg.cn/20210609154413921.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
深度学习
文章平均质量分 64
小陈要努力用pytorch实现深度学习模型!
缦旋律
沉迷磕CP并努力敲代码的小陈
展开
-
cross-product transformation
Let’s do this in the opposite order of how you asked. i.e. first:How can I think of the cross-product transformation in general?For me a cross-product comes from linear algebra, and it is a different transformation. Therefore let’s start by not confusing原创 2021-12-05 11:21:44 · 241 阅读 · 0 评论 -
language model with pointer network
1.什么是pointer network如上图所示,P1,P2,P3,P4P_1,P_2,P_3,P_4P1,P2,P3,P4的坐标分别为(x1,y1x_1,y_1x1,y1),(x2,y2x_2,y_2x2,y2),(x3,y3x_3,y_3x3,y3),(x4,y4x_4,y_4x4,y4),我们想从这些点中找出几个点,这几个点的坐标连起来后,能涵盖所有点。以上面这幅图为例,将各个点的坐标输入encoder后,decoder依次输出1、4、2、1。P1,P4,P2P_1,P原创 2021-06-12 16:30:55 · 148 阅读 · 0 评论 -
隐马尔可夫模型(HMM)and维比特算法
之前手写的笔记,害怕哪天找不到了,就先拍照放上来,以后有时间再整理成电子版。(write to myself:看不懂步骤的可以先去看每个后面的例子~)原创 2021-06-10 16:58:15 · 160 阅读 · 0 评论 -
LSTM实战:空气质量预测
LSTM实战:空气质量预测。pytorch代码,超详细。原创 2020-10-17 08:33:12 · 13271 阅读 · 42 评论 -
pytorch实现seq2seq(二):Luong_attention机制
本篇实现的是Luong的attention,即: 其中hˉs\bar{h}_shˉs表示encoder每个hidden_state的输出,hth_tht表示decoder每个hidden_state的输出。文章目录1.载入原始数据2.数据预处理2.1 中英文分词2.2 建立词典2.3 使用词典来对原始句子进行编码2.4 划分训练集和原创 2021-06-06 17:45:39 · 1285 阅读 · 2 评论 -
pytorch实现seq2seq(一)
文章目录1.载入原始数据2.数据预处理2.1 中英文分词2.2 建立词典2.3 使用词典来对原始句子进行编码2.4 划分训练集和验证集2.5 自定义dataloader3.搭建模型3.1 encoder3.2 decoder3.3 seq2seq3.4 自定义损失函数4.训练模型4.1 初始化模型4.2 定义训练过程和验证过程的函数4.3 开始训练5.检验效果import osimport sysimport mathfrom collections import Counterimport nu原创 2021-06-05 23:56:43 · 1341 阅读 · 1 评论 -
pytorch实现情感分类(wordavg&lstm&cnn)
文章目录1.数据准备2.wordavg model2.1定义模型2.2设置参数2.3 初始化模型2.4 glove初始化模型embedding层2.5 定义训练过程、评估函数2.6 开始训练2.7 检验分类效果3.LSTM模型4.CNN 模型import torchimport torchtextfrom torchtext import datafrom torchtext import datasetsfrom torchtext.vocab import GloVeimport spacy原创 2021-06-03 11:15:00 · 716 阅读 · 0 评论 -
使用LSTM训练语言模型(以《魔道祖师》为corpus)
import torchtextfrom torchtext.vocab import Vectorsimport torch from torch import nnimport numpy as npimport randomimport jiebarandom.seed(53113)np.random.seed(53113)torch.manual_seed(53113)use_cuda = torch.cuda.is_available()if use_cuda: t原创 2021-06-01 21:48:59 · 873 阅读 · 0 评论 -
attention/self-attention
attention详细版请戳这里self-attention详细版请戳这里(transformer中的self-attention)原创 2021-05-27 13:54:26 · 173 阅读 · 0 评论