![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Image Caption
饿了就干饭
经常更新NLP、深度学习相关内容,感兴趣的话可以关注哈~
展开
-
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 · 1318 阅读 · 0 评论 -
复现网状的记忆Transformer图像描述模型(失败)
复现该项目的代码失败:aimagelab/meshed-memory-transformer复现时参考该博主的文章:meshed-memory transformer代码实现(绝对详细)(然而还是未成功!)复现时遇到的问题以及解决方案(供参考,有人复现成功啦,评论告诉一下哈,想参考参考呢)参考链接:1、安装pycocotools失败解决方法:在windows环境下安装pycocotools(这种方法下载的文件需要放在C:\Users\deep\anaconda3\Lib\site-packages原创 2022-03-09 20:11:24 · 915 阅读 · 2 评论 -
输出每一步的损失
# 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 · 345 阅读 · 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 · 453 阅读 · 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 · 458 阅读 · 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 · 471 阅读 · 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 · 81 阅读 · 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 · 1406 阅读 · 0 评论 -
Show Attend and Tell的实现代码中的python知识学习
Show Attend and Tell的实现代码中的python知识学习原创 2021-12-26 22:26:02 · 392 阅读 · 0 评论 -
show attend and tell代码实现(绝对详细)
走过路过不要错过~~~~原创 2021-09-06 20:13:36 · 9757 阅读 · 76 评论 -
【CVPR2020 image caption】读Meshed-Memory Transformer for Image Captioning
论文信息论文名称:Meshed-Memory Transformer for Image Captioning(用于图像描述的带存储器的网状Transformer)原论文地址: 下载地址官方开源代码地址:代码本篇博客参考文章:1、[CVPR2020] Meshed-Memory Transformer for Image Captioning2、论文笔记:Meshed-Memory_Transformer_for_Image_Captioning_CVPR2020Meshed-Memory T原创 2021-11-23 21:24:43 · 4292 阅读 · 0 评论