pytorch机器学习
PyTorch : It is an open source machine learning library based on the Torch library (which is based on Lua Programming Language), developed by Facebook’s AI Research lab.
PyTorch:这是一个基于Torch库(基于Lua编程语言)的开源机器学习库,该库由Facebook的AI Research Lab开发。
It can also use the power of graphics processing unit and so it is one of the preferred library for deep learning. TensorFlow is another great library for tensor operations in deep learning.
它还可以利用图形处理单元的功能,因此它是深度学习的首选库之一。 TensorFlow是另一个用于深度学习中的张量操作的出色库。
PyTorch is easy to learn and integrates easily with other python packages makes it a simple choice for researchers to use.
PyTorch易于学习,并且易于与其他python软件包集成,这使其成为研究人员使用的简单选择。
Tensor : A tensor is a generalization of scalar, vectors and matrices or we can say these are the special cases of a tensor and can easily understood as a multidimensional array. All values in a tensor hold identical data type with a known (or partially known) shape.
张量:张量是标量,向量和矩阵的泛化,或者我们可以说这些是张量的特例,可以很容易地理解为多维数组。 张量中的所有值均具有相同的数据类型,且具有已知(或部分已知)的形状。
Install the PyTorch python library : from here
从这里安装PyTorch python库:
Syntax to create tensor with PyTorch :
使用PyTorch创建张量的语法:
This is how you can create n-dimensional tensors with PyTorch.
这就是使用PyTorch创建n维张量的方法。
以下是一些PyTorch函数,我们将进行探索: (Here are some of the PyTorch functions, we are going to explore:)
view, flip, ne, topk, bincount
查看,翻转,ne,topk,bincount