pytorch
cc 提升ing 变优秀ing
有需要搜广推nlp实习生的部门吗?
展开
-
pytorch官方教程学习笔记08:SEQUENCE-TO-SEQUENCE MODELING WITH NN.TRANSFORMER AND TORCHTEXT
1.seq2seq的transformer模型图:2.本节任务:The language modeling task is to assign a probability for the likelihood of a given word (or a sequence of words) to follow a sequence of words.语言建模任务是为给定的单词(或单词序列)与单词序列之间的关系分配一个概率。3.TransformerEncoderLaye:官方链接is made原创 2020-11-21 11:44:10 · 1062 阅读 · 1 评论 -
pytorch官方教程学习笔记02:AUTOGRAD自动求导
官网1.创建可求梯度的:创建一个可以求梯度的张量:requires_grad=Truex = torch.ones(2, 2, requires_grad=True)print(x)之后添加:a.requires_grad_(True)2.求Gradients:out.backward()则,计算out的所有的变量。都计算出了其对应的梯度,若由x计算出了out:print(x.grad)3.特殊,由于计算出y有分段函数,整体不是可求导的,那么:应该给定值让其求导:v = t原创 2020-11-19 15:48:27 · 142 阅读 · 1 评论 -
pytorch官方教程学习笔记01:WHAT IS PYTORCH?
官网1.创建张量:大小为5行3列:whatever values were in the allocated memory at the time will appear as the initial values.x = torch.empty(5, 3)随机初始化:x = torch.rand(5, 3)全零+指定类型:x = torch.zeros(5, 3, dtype=torch.long)**自定义初始化:需要用到:【】 **x = torch.tensor([[1,原创 2020-11-19 15:12:53 · 81 阅读 · 1 评论 -
pytorch官方教程学习笔记11:LSTM
鏈接1.输入形状必须是三维的:Pytorch’s LSTM expects all of its inputs to be 3D tensors. The semantics of the axes of these tensors is important. The first axis is the sequence itself, the second indexes instances in the mini-batch, and the third indexes elements of th原创 2020-11-24 09:37:58 · 439 阅读 · 0 评论 -
pytorch官方教程:DEEP LEARNING FOR NLP WITH PYTORCH
链接(https://pytorch.org/tutorials/beginner/deep_learning_nlp_tutorial.html?highlight=crf)原创 2020-11-14 10:10:09 · 141 阅读 · 0 评论 -
pytorch官方教程学习笔记10:embedding
1.embedding等模型的层的参数会随机初始化,而且随机初始化是由所给的torch.manual_seed(1)决定的:每一个定义的网络层是可以直接用来测试的,因为它是有权重的,但是权重因为是随机的,是没有经过大量训练来优化的,所以直接出来的结果也是肆无忌惮的:我首先将随机种子设置为1import torchimport torch.nn as nnimport torch.nn.functional as Fimport torch.optim as optimtorch.manual_原创 2020-11-23 21:23:51 · 401 阅读 · 1 评论 -
pytorch常用函数总结:nlp的任务中遇到的。
由于自己在啃代码,所以不自己写了,只给链接。Field:处理数据参考原创 2020-11-16 10:23:29 · 591 阅读 · 0 评论