pytorch

How to do scatter and gather operations in numpy?

大憨熊 提交于 2021-01-27 04:35:09
问题 I want to implement scatter and gather operations of Tensorflow or PyTorch in Numpy. I have been scratching my head for a while. Any pointers are greatly appreciated! PyTorch Scatter PyTorch Gather 回答1: The scatter method turned out to be way more work than I anticipated. I did not find any ready made function in NumPy for it. I'm sharing it here in the interest of anyone who may need to implement it with NumPy. (p.s. self is the destination or output of the method.) def scatter_numpy(self,

How to do scatter and gather operations in numpy?

…衆ロ難τιáo~ 提交于 2021-01-27 04:35:08
问题 I want to implement scatter and gather operations of Tensorflow or PyTorch in Numpy. I have been scratching my head for a while. Any pointers are greatly appreciated! PyTorch Scatter PyTorch Gather 回答1: The scatter method turned out to be way more work than I anticipated. I did not find any ready made function in NumPy for it. I'm sharing it here in the interest of anyone who may need to implement it with NumPy. (p.s. self is the destination or output of the method.) def scatter_numpy(self,

How to include batch size in pytorch basic example?

好久不见. 提交于 2021-01-27 04:12:40
问题 I am new to pytorch. The following is the basic example of using nn module to train a simple one-layer model with some random data (from here) import torch N, D_in, H, D_out = 64, 1000, 100, 10 x = torch.randn(N, D_in) y = torch.randn(N, D_out) model = torch.nn.Sequential( torch.nn.Linear(D_in, H), torch.nn.ReLU(), torch.nn.Linear(H, D_out), ) loss_fn = torch.nn.MSELoss(reduction='sum') optimizer = torch.optim.Adam(model.parameters(), lr=1e-4) for t in range(500): y_pred = model(x) loss =

最全的免费SPSS视频教程

萝らか妹 提交于 2021-01-26 07:17:31
向AI转型的程序员都关注了这个号 👇👇👇 人工智能大数据与深度学习 公众号:datayx 自学SPSS,有哪些教学视频或书籍推荐? 因为项目的需要,想自学spss软件,请问有哪些比较好的教学视频或自学书籍可以借鉴? SPSS主要有两个产品:统计分析的Statistics,以及数据挖掘的Modeler 一、楼主想学Statistics,研究统计分析的话,我会推荐张文彤如下的系列: 1.SPSS统计分析基础教程 (豆瓣) 豆瓣评分8.4 以真实案例贯穿全书,从统计分析实战的角度出发详细介绍SPSS的界面操作、数据管理、统计图表制作、统计描述和常用单因素统计分析方法的原理与实际操作,并结合SPSS的强大功能进行很好地扩展。书中还提供医疗、经济、市场研究等各行业的综合案例,完全从实际案例出发讲解各类方法的综合运用,以更好地协助读者提高实战能力。 2.高等学校教材 (豆瓣)(SPSS统计分析高级教程)豆瓣评分7.7 《高等学校教材:SPSS统计分析高级教程(第2版)》以IBMSPSSStatistics20中文版为基础,全面、系统地介绍了各种多变量统计模型、多元统计分析模型、智能统计分析方法的原理和软件实现。在书中作者结合自身多年的统计分析实战和SPss行业应用经验,侧重于对统计新方法、新观点的讲解。在保证统计理论严谨的同时,又充分注重了文字的浅显易懂,使《高等学校教材

PyTorch equivalence for softmax_cross_entropy_with_logits

时间秒杀一切 提交于 2021-01-26 03:48:38
问题 I was wondering if there is an equivalent loss function in PyTorch for TensorFlow's softmax_cross_entropy_with_logits . 回答1: equivalent loss function in PyTorch for TensorFlow's softmax_cross_entropy_with_logits It is torch.nn.functional.cross_entropy It takes logits as inputs (performs log_softmax internally). In here logits are just some values that are not probabilities, outside of [0,1] interval. But, logits are also the values that will be converted to probabilities. If you consider the

LSTM for time-series prediction failing to learn (PyTorch)

社会主义新天地 提交于 2021-01-24 20:16:31
问题 I'm currently working on building an LSTM network to forecast time-series data using PyTorch. I tried to share all the code pieces that I thought would be helpful, but please feel free to let me know if there's anything further I can provide. I added some comments at the end of the post regarding what the underlying issue might be. From the univariate time-series data indexed by date, I created 3 date features and split the data into training and validation sets as below. # X_train weekday

OCR文字识别:水平和垂直图像训练crnn模型

拟墨画扇 提交于 2021-01-24 14:40:12
向AI转型的程序员都关注了这个号 👇👇👇 机器学习AI算法工程 公众号:datayx crnn.pytorch 本工程使用随机生成的水平和垂直图像训练crnn模型做文字识别;一共使用10多种不同字体;共包括数字、字符、简体和繁体中文字30656个,详见all_words.txt。 预测 1.1 直接预测 1.2 使用restful服务预测 模型效果 2.1 水平方向 2.2 垂直方向 评估 训练 代码 以及运行教程 获取: 关注微信公众号 datayx 然后回复 OCR 即可获取。 AI项目体验地址 https://loveai.tech 预测 直接预测 a) 执行如下命令预测单个图像 使用restful服务预测 a) 启动restful服务 模型效果 以下图像均来为生成器随机生成的,也可以试用自己的图像测试 水平方向 垂直方向 从左到右识别结果 评估 a) 水平方向 训练 a) 单机多卡 阅读过本文的人还看了以下文章: TensorFlow 2.0深度学习案例实战 基于40万表格数据集TableBank,用MaskRCNN做表格检测 《基于深度学习的自然语言处理》中/英PDF Deep Learning 中文版初版-周志华团队 【全套视频课】最全的目标检测算法系列讲解,通俗易懂! 《美团机器学习实践》_美团算法团队.pdf 《深度学习入门:基于Python的理论与实现

ACL-2021交流群

时光毁灭记忆、已成空白 提交于 2021-01-24 09:43:18
ACL2021目前距离投稿还有10天左右时间。之前建立了交流群,方便大家交流。 有投稿的同学可以加群交流,进群的各位同学请将备注改为 姓名+学校+方向 ,便于交流,大家交流的时候不要透露投稿id,不要透露任何违背双盲原则的信息,感谢大家配合。 想要入群的同学,可以添加yizhen-nlp ,备注 ACL-学校-姓名-方向(由于是我个人的微信号,不加备注不会接受同意,望谅解),一定要有投稿需求的同学,谢谢 。 推荐阅读 NAACL2021-交流群 【招人】腾讯广告业务线 赛尔笔记 | 篇章级机器翻译简介 清华CoAI课题组新书《现代自然语言生成》正式发布! GPT“高仿”系列开源了!最大可达GPT-3大小,还能自主训练 ACL 2021投稿避坑指南 我,大学没毕业,在OpenAI搞AI,想教教你如何提升“研究品味” 推荐几本经典AI书籍! 赛尔原创@AAAI 2021 | 纠结于联合学习中的建模方法?快来看看图网络显式建模! 如何提高PyTorch“炼丹”速度?这位小哥总结了17种方法,可直接上手更改的那种 斯坦福CS224W《图机器学习》2021开课!Jure Leskovec大牛主讲,附课程PPT下载 ICLR2021放榜!录取860篇,接受率为28.7%! 计算机视觉中的Transformer 第二十届中国计算语言学大会(CCL 2021)技术评测任务征集 完全图解GPT-2

Best loss function for multi-class classification when the dataset is imbalance?

谁说我不能喝 提交于 2021-01-24 07:42:31
问题 I'm currently using the Cross Entropy Loss function but with the imbalance data-set the performance is not great. Is there better lost function? 回答1: It's a very broad subject, but IMHO, you should try focal loss: It was introduced by Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He and Piotr Dollar to handle imbalance prediction in object detection. Since introduced it was also used in the context of segmentation. The idea of the focal loss is to reduce both loss and gradient for correct

Best loss function for multi-class classification when the dataset is imbalance?

被刻印的时光 ゝ 提交于 2021-01-24 07:40:09
问题 I'm currently using the Cross Entropy Loss function but with the imbalance data-set the performance is not great. Is there better lost function? 回答1: It's a very broad subject, but IMHO, you should try focal loss: It was introduced by Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He and Piotr Dollar to handle imbalance prediction in object detection. Since introduced it was also used in the context of segmentation. The idea of the focal loss is to reduce both loss and gradient for correct