饿了就干饭
经常更新NLP、深度学习相关内容,感兴趣的话可以关注哈~
展开
-
show attend and tell代码实现(绝对详细)
走过路过不要错过~~~~原创 2021-09-06 20:13:36 · 9956 阅读 · 79 评论 -
Flickr8k和Flickr30k测试的指标
Flickr8k测试的指标EVALUATING AT BEAM SIZE 5: 0%| | 0/5000 [00:00<?, ?it/s]..\aten\src\ATen\native\BinaryOps.cpp:81: UserWarning: Integer division of tensors using div or / is deprecated, and in a future release div will perform true division as i原创 2022-03-20 13:39:16 · 1972 阅读 · 1 评论 -
show attend and tell 计算bleu分数(1到4)
Calculate BLEU scores主要是参数的改变,默认计算的是BLEU4的分数,从源码中也可以看出来# Calculate BLEU-4 scoresbleu4 = corpus_bleu(references, hypotheses)# weights = (1.0 / 1.0,)bleu1 = corpus_bleu(references, hypotheses, (1.0 / 1.0,))bleu2 = corpus_bleu(references, hypotheses, (1原创 2022-03-13 20:05:17 · 1365 阅读 · 0 评论 -
show attend and tell代码中utils的中类AverageMeter
类AverageMeterclass AverageMeter(object): """Keeps track of most recent, average, sum, and count of a metric.""" def __init__(self): self.reset() def reset(self): self.val = 0 self.avg = 0 self.sum = 0 se原创 2022-03-13 16:42:07 · 444 阅读 · 0 评论 -
Flickr30k图像标注数据集下载及使用方法(转载的,备忘)
Flickr30k图像标注数据集下载及使用方法这是该博主贴的链接:Flickr30k图像标注数据集下载及使用方法直接从百度云盘中下载链接:https://pan.baidu.com/s/1r0RVUwctJsI0iNuVXHQ6kA 密码:hrf3flickr30k-images.tar是图像,flickr30k.tar.gz是标注。...转载 2022-03-12 00:11:59 · 4126 阅读 · 2 评论 -
dataset_flickr8k.json与dataset_flickr30k.json的比较
格式实际是一样的,但是图片顺序可能是打乱的(分别截取了UltraEdit中的一行){"images": [{"sentids": [0, 1, 2, 3, 4], "imgid": 0, "sentences": [{"tokens": ["a", "black", "dog", "is", "running", "after", "a", "white", "dog", "in", "the", "snow"], "raw": "A black dog is running after a white原创 2022-03-11 23:36:34 · 1155 阅读 · 0 评论 -
深度学习如何验证自己的想法
知乎链接:深度学习如何验证自己的想法转载 2022-03-11 21:27:17 · 172 阅读 · 0 评论 -
show attend and tell中的文件dataset_coco.json的格式
{ "images": [{ "filepath": "val2014", "sentids": [770337, 771687, 772707, 776154, 781998], "filename": "COCO_val2014_000000391895.jpg", "imgid": 0, "split": "test", "sentences": [{ "tokens": ["a", "man", "with", "a", "red", "helmet", "on",原创 2022-03-11 10:44:41 · 476 阅读 · 0 评论 -
输出每一步的损失
# pytorch中如何处理RNN输入变长序列padding:https://zhuanlan.zhihu.com/p/34418001?edition=yidianzixun&utm_source=yidianzixun&yidian_docid=0IVwLf60for i, (imgs, caps, caplens) in enumerate(train_loader): ... scores = pack_padded_sequence(scores, decode_length原创 2022-01-10 17:24:11 · 364 阅读 · 0 评论 -
pytorch中如何处理RNN输入变长序列padding
参考:pytorch中如何处理RNN输入变长序列paddingscores = pack_padded_sequence(scores, decode_lengths, batch_first=True)[0]print(scores)输出:tensor([[-0.4747, -0.2187, 0.0079, ..., -0.1897, 0.1499, -0.2167], [-0.1367, -0.0542, 0.1444, ..., -0.0256, 0.2725,原创 2022-01-10 17:08:46 · 498 阅读 · 0 评论 -
对描述进行处理
scores, caps_sorted, decode_lengths, alphas, sort_ind = decoder(imgs, caps, caplens)# Since we decoded starting with <start>, the targets are all words after <start>, up to <end>targets = caps_sorted[:, 1:]print(targets)输出:(输出结果应该是对以原创 2022-01-10 16:42:53 · 469 阅读 · 0 评论 -
打印Show Attend and Tell的损失函数
打印Show Attend and Tell的损失函数criterion = nn.CrossEntropyLoss().to(device)print(criterion)输出:CrossEntropyLoss()#交叉熵损失函数normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])print(normal原创 2022-01-09 23:37:27 · 496 阅读 · 0 评论 -
打印Show Atend and Tell编码器的优化器
打印编码器的优化器encoder_optimizer = torch.optim.Adam(params=filter(lambda p: p.requires_grad, encoder.parameters()), lr=encoder_lr) if fine_tune_encoder else Noneprint(encoder_optimizer)输出None原创 2022-01-09 16:15:00 · 95 阅读 · 0 评论 -
打印show attend and tell的编码器网络结构
打印show attend and tell的编码器网络结构encoder = Encoder()print(encoder)输出:Encoder( (resnet): Sequential( (0): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False) (1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, tra原创 2022-01-09 16:06:19 · 1422 阅读 · 0 评论 -
打印show attend and tell的解码器网络结构
打印show attend and tell的解码器网络结构if checkpoint is None:# 执行这一步 decoder = DecoderWithAttention(attention_dim=attention_dim, embed_dim=emb_dim, decoder_dim=decoder_dim,原创 2022-01-09 15:21:40 · 1353 阅读 · 0 评论 -
Show Attend and Tell的词表
dataset_Flickr8k的词表{'a': 1, 'black': 2, 'dog': 3, 'is': 4, 'running': 5, 'after': 6, 'white': 7, 'in': 8, 'the': 9, 'snow': 10, 'chasing': 11, 'brown': 12, 'through': 13, 'two': 14, 'dogs': 15, 'chase': 16, 'each': 17, 'other': 18, 'across': 19, 'snowy':原创 2021-12-28 21:43:10 · 398 阅读 · 0 评论 -
Show Attend and Tell的实现代码中的python知识学习
Show Attend and Tell的实现代码中的python知识学习原创 2021-12-26 22:26:02 · 427 阅读 · 0 评论 -
从零学习SwinTransformer
先学Transformer回顾TRM和VIT模型,理清SwinTRM的创新点SwinTRM使⽤到相对位置编码介绍窗⼝移动注意⼒机制SW-MSA介绍Patch Merging介绍Transformer中并不是所有的输入都加入位置编码回顾Vit模型原创 2021-11-19 15:49:48 · 1334 阅读 · 1 评论