pytorch

从2020昇腾计算产业峰会,看产业生态如何加速AI普惠

谁说我不能喝 提交于 2020-12-12 18:44:35
文 | 曾响铃 来源 | 科技向令说(xiangling0815) 最近,以“昇腾万里,让智能无所不及”为主题的首届昇腾计算产业峰会在上海举办,业内专家、行业先锋、生态伙伴约500多人见证两年后昇腾AI计算产业的全面落地进程。 这个峰会,距离2018年华为Ascend(昇腾)系列产品面世,整整两年时间。 两年间,华为持续投入AI战略,推动昇腾计算产业生态快速发展。 随着此次峰会上《昇腾计算产业发展白皮书》、《昇腾万里伙伴计划》的发布,昇腾计算产业的全面繁荣已经在行业共识基础上按下了启动键。而在业内引发广泛关注的这次峰会,也在AI加速落地的时代勾勒出昇腾通过产业生态的强化推动“AI普惠”的图景——这正是华为两年前发布AI战略和全栈全场景AI解决方案时的重要目标。 市场数据显示,虽然AI在某些特定领域特定场景下准确率已经超过人类,但其全行业渗透率仅有4%,在中国市场,只有10%的B2C应用涉及AI。这些数字,距离AI走向普罗大众,让每个人、每个家庭、每个组织都能享受到人工智能的价值,还有很大的距离。 这个距离,恰恰是昇腾计算产业的价值空间。 01 全栈技术体系,让昇腾计算产业生态拥有全面且灵活的技术支撑 这次昇腾峰会主要动作都聚焦在生态构建上,在谈这些生态动作之前,有必要对昇腾当下已有的技术底子做一个全面剖析。 总体来看,在昇腾生态的主要推动者华为营造下

ImportError: cannot import name 'AutoModelWithLMHead' from 'transformers'

自作多情 提交于 2020-12-12 12:20:33
问题 This is literally all the code that I am trying to run: from transformers import AutoModelWithLMHead, AutoTokenizer import torch tokenizer = AutoTokenizer.from_pretrained("microsoft/DialoGPT-small") model = AutoModelWithLMHead.from_pretrained("microsoft/DialoGPT-small") I am getting this error: --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-14-aad2e7a08a74> in <module> ----> 1 from transformers import

招聘信息 | 眼控科技3个岗位招聘,AI气象研究员(30-60K·14薪)

家住魔仙堡 提交于 2020-12-12 07:15:59
介绍 上海眼控科技股份有限公司成立于 2009 年,是一家集计算机视觉识别与深度学习技术研发应用于一体的全球性人工智能科技企业。经过多年的极致追求与打磨,推出了一系列人工智能技术,包括:人脸识别、目标检测与识别、OCR、人体关键点检测& 姿态识别、场景语义理解、模型压缩与蒸馏、车辆与行人 ReID 和追踪等。眼控科技已成为中国领先的 AI 智慧交通、智慧气象领域解决方案提供商。 眼控科技汇聚了来自美国斯坦福大学、纽约大学、香港科技大学等国内外知名大学的顶尖 AI 人才 100 余名,先后在道路交通领域,联合公安部交通管理科学研究所、上海交大人工智能研究院建立全国首家 AI+ 道路安全监管创新中心。同时,联合华东空管局气象中心、上海交大人工智能研究院建立全国首家航空智慧气象创新中心。眼控科技在智慧道路交通、智慧航空气象垂直领域的市场占有率已位居行业领先地位,产品覆盖北京、上海、天津、河北、山东等 30 多个省市。 使命:用人工智能提供更安全更高效的交通安全解决方案 愿景:成为全球AI领域最具创新活力的企业 价值观:敬业、创新、协作、自信 眼控科技大事记: 2009年,眼控科技成立,深度探索人工智能技术; 2013年,与上海交大、公安部无锡所成立道路交通联合实验室; 2015年,探索航空气象领域AI技术研究; 2017年,道路交通安全智能监管领域市场占有率第一; 2018年

Should a data batch be moved to CPU and converted (from torch Tensor) to a numpy array when doing evaluation w.r.t. a metric during the training?

落花浮王杯 提交于 2020-12-12 01:51:55
问题 I am going through Andrew Ng’s tutorial from the CS230 Stanford course, and in every epoch of the training, evaluation is performed by calculating the metrics. But before calculating the metrics, they are sending the batches to CPU and converting them to numpy arrays (code here). # extract data from torch Variable, move to cpu, convert to numpy arrays output_batch = output_batch.data.cpu().numpy() labels_batch = labels_batch.data.cpu().numpy() # compute all metrics on this batch summary_batch

How to find built-in function source code in pytorch

妖精的绣舞 提交于 2020-12-11 07:57:33
问题 I am trying to do research on batch normalization, and had to make some modifications for the pytorch BN code. I dig into the pytorch code and got stuck with torch.nn.functional.batch_norm , which references torch.batch_norm. The problem is that torch.batch_norm cannot be further found in the torch library. Is there any way I can find the source code of this built-in function and re-implement it? Thanks! 回答1: It's there, but it's not defined in Python. They're defined in C++ in the aten/

Adding class objects to Pytorch Dataloader: batch must contain tensors

邮差的信 提交于 2020-12-08 04:05:08
问题 I have a custom Pytorch dataset that returns a dictionary containing a class object "queries". class QueryDataset(torch.utils.data.Dataset): def __init__(self, queries, values, targets): super(QueryDataset).__init__() self.queries = queries self.values = values self.targets = targets def __len__(self): return self.values.shape[0] def __getitem__(self, idx): sample = DeviceDict({'query': self.queries[idx], "values": self.values[idx], "targets": self.targets[idx]}) return sample The problem is

Adding class objects to Pytorch Dataloader: batch must contain tensors

浪尽此生 提交于 2020-12-08 03:59:05
问题 I have a custom Pytorch dataset that returns a dictionary containing a class object "queries". class QueryDataset(torch.utils.data.Dataset): def __init__(self, queries, values, targets): super(QueryDataset).__init__() self.queries = queries self.values = values self.targets = targets def __len__(self): return self.values.shape[0] def __getitem__(self, idx): sample = DeviceDict({'query': self.queries[idx], "values": self.values[idx], "targets": self.targets[idx]}) return sample The problem is

Measuring uncertainty using MC Dropout on pytorch

穿精又带淫゛_ 提交于 2020-12-06 16:01:47
问题 I am trying to implement Bayesian CNN using Mc Dropout on Pytorch, the main idea is that by applying dropout at test time and running over many forward passes , you get predictions from a variety of different models. I’ve found an application of the Mc Dropout and I really did not get how they applied this method and how exactly they did choose the correct prediction from the list of predictions here is the code def mcdropout_test(model): model.train() test_loss = 0 correct = 0 T = 100 for

【PyTorch】PyTorch中的梯度累加

一笑奈何 提交于 2020-12-06 12:40:20
PyTorch中的梯度累加 使用PyTorch实现梯度累加变相扩大batch PyTorch中在反向传播前为什么要手动将梯度清零? - Pascal的回答 - 知乎 https://www.zhihu.com/question/303070254/answer/573037166 这种模式可以让梯度玩出更多花样,比如说梯度累加(gradient accumulation) 传统的训练函数,一个batch是这么训练的: for i,(images,target) in enumerate(train_loader): # 1. input output images = images.cuda(non_blocking=True) target = torch.from_numpy(np.array(target)).float().cuda(non_blocking=True) outputs = model(images) loss = criterion(outputs,target) # 2. backward optimizer.zero_grad() # reset gradient loss.backward() optimizer.step() 获取loss:输入图像和标签,通过infer计算得到预测值,计算损失函数; optimizer.zero_grad()

《Python与机器学习实战》笔记+源码

白昼怎懂夜的黑 提交于 2020-12-05 19:46:38
向AI转型的程序员都关注了这个号 👇👇👇 机器学习AI算法工程 公众号:datayx Python与机器学习这一话题是如此的宽广,仅靠一本书自然不可能涵盖到方方面面,甚至即使出一个系列的书也难能做到这点。单就机器学习而言,其领域就包括但不限于如下:有监督学习(Supervised Learning),无监督学习(Unsupervised Learning)和半监督学习(Semi-Supervised Learning)。而其具体的问题又大致可以分为两类:分类问题(Classification)和回归问题(Regression)。 Python本身带有许多机器学习的第三方库,但《Python与机器学习实战:决策树、集成学习、支持向量机与神经网络算法详解及编程实现》在绝大多数情况下只会用到Numpy这个基础的科学计算库来进行算法代码的实现。这样做的目的是希望读者能够从实现的过程中更好地理解机器学习算法的细节,以及了解Numpy的各种应用。不过作为补充,《Python与机器学习实战:决策树、集成学习、支持向量机与神经网络算法详解及编程实现》会在适当的时候应用scikit-learn这个成熟的第三方库中的模型。 《Python与机器学习实战:决策树、集成学习、支持向量机与神经网络算法详解及编程实现》适用于想了解传统机器学习算法的学生和从业者,想知道如何高效实现机器学习算法的程序员