摘要: 1.Shell脚本 脚本以#!/bin/bash开头(指定解析器) 创建一个shell脚本,输出helloword [ datas]$ touch helloworld.sh [ datas]$ vi helloworld.sh 在helloworld.sh中输入如下内容 #!/bin/bash e 阅读全文
posted @ 2021-07-15 19:48 Nakkk 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 斯坦福公开课 cs224d 论文 Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation Effective Approaches to Attention-based 阅读全文
posted @ 2021-07-08 21:20 Nakkk 阅读(103) 评论(0) 推荐(0) 编辑
摘要: import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms # torchvis 阅读全文
posted @ 2021-07-08 21:15 Nakkk 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 第一步:导入豆瓣电影数据集,只有训练集和测试集 TorchText中的一个重要概念是Field。Field决定了你的数据会被怎样处理。在我们的情感分类任务中,我们所需要接触到的数据有文本字符串和两种情感,"pos"或者"neg"。 Field的参数制定了数据会被怎样处理。 我们使用TEXT fiel 阅读全文
posted @ 2021-07-08 21:07 Nakkk 阅读(509) 评论(0) 推荐(0) 编辑
摘要: 第三节课笔记: #注:随堂笔记中使用的torchtext已经更新,部分代码不能使用,请对照官方README使用 torchtext 创建vocabulary import torchtext from torchtext.vocab import Vectors import torch impor 阅读全文
posted @ 2021-07-08 20:30 Nakkk 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 第二节课笔记: 词向量是一种分布式表示 由论文Distributed Representations of Words and Phrases and their Compositionality提出 具体原理可看斯坦福公开课cs224n的第一节讲的简单易懂 import torch import 阅读全文
posted @ 2021-07-08 20:17 Nakkk 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 课程地址:https://www.bilibili.com/video/BV12741177Cu 第一节课课程笔记: PyTorch与其他框架的对比 - PyTorch: 动态计算图 Dynamic Computation Graph - Tensorflow: 静态计算图 Static Compu 阅读全文
posted @ 2021-07-08 19:34 Nakkk 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Kim Y . Convolutional Neural Networks for Sentence Classification[J]. Eprint Arxiv, 2014. Abstract 文章主要内容是作者做的一系列实验,使用在预训练词向量上训练的卷积神经网络(cnn)用于句子级分类任务。 阅读全文
posted @ 2021-07-03 11:36 Nakkk 阅读(242) 评论(0) 推荐(0) 编辑
摘要: # coding=gbk import os import os.path import natsort def GetFileList(dir, fileList): newDir = dir if os.path.isfile(dir): fileList.append(dir) elif os 阅读全文
posted @ 2021-04-19 20:50 Nakkk 阅读(400) 评论(0) 推荐(0) 编辑
摘要: 1.损失函数就是代价函数 例如: 损失函数用于度量标签的真实值和预测值的误差。 常用的损失函数有:0-1损失函数,平方损失函数,期望损失函数。 2.评分函数 以输入x和权值Wi为自变量的一个函数,比如评价x属于某个分类的可能性的分值; 得分函数就是对于给定的一个输入,通过计算,得到这个输入属于每种类 阅读全文
posted @ 2021-03-27 20:44 Nakkk 阅读(691) 评论(0) 推荐(0) 编辑