pytorch 全局变量
by Déborah Mesquita
由DéborahMesquita
Pytorch如何通过深度学习展现全局 (How Pytorch gives the big picture with deep learning)
Some time ago we saw how to classify texts with neural networks. The article covered the following topics:
前段时间,我们看到了如何使用神经网络对文本进行分类 。 本文介绍了以下主题:
- What is a machine learning model 什么是机器学习模型
- What is a neural network 什么是神经网络
- How the neural network learns 神经网络如何学习
- How to manipulate data and pass it to the neural network inputs 如何处理数据并将其传递给神经网络输入
- How to run the model and get the results for the prediction 如何运行模型并获得预测结果
In today’s article, we are going to build the same network, but instead of using TensorFlow, we are going to use Pytorch. We’ll focus only on the code. So if you need a primer on neural networks, it’s a good idea to check out the previous article. :)
在今天的文章中,我们将构建相同的网络,但是我们将使用Pytorch而不是使用TensorFlow 。 我们将只关注代码。 因此,如果您需要有关神经网络的入门知识,那么最好查阅上一篇文章 。 :)
We’ll create a machine learning model that classifies texts into categories. The dataset is the 20 Newsgroups, which contains 18,000 posts about 20 different topics. We will use only 3 categories: comp.graphics, sci.space, and rec.sport.baseball.
我们将创建一个将文本分类的机器学习模型。 数据集是20个新闻组 ,其中包含有关20个不同主题的18,000个帖子。 我们将仅使用3个类别:comp.graphics,sci.space和rec.sport.baseball。
什么是Pytorch? (What is Pytorch?)
Pytorch is a Python-based scientific computing package that is a replacement for NumPy, and uses the power of Graphics