PyTorch深度學(xué)習(xí)快速入門

  • 名稱:PyTorch深度學(xué)習(xí)快速
  • 分類:人工智能  
  • 觀看人數(shù):加載中
  • 時(shí)間:2022/7/23 11:29:29

1.Pytorch簡(jiǎn)介:        

Pytorch是Python里的用來(lái)進(jìn)行深度學(xué)習(xí)的框架,能夠在強(qiáng)大的GPU加速基礎(chǔ)上實(shí)現(xiàn)張量和動(dòng)態(tài)神經(jīng)網(wǎng)絡(luò),如果沒(méi)有GPU,也支持CPU版本的。它的一大優(yōu)勢(shì)就是動(dòng)態(tài)計(jì)算特征,也就是計(jì)算圖在運(yùn)行的時(shí)候創(chuàng)建。目前市場(chǎng)上支持動(dòng)態(tài)計(jì)算的框架有Pytorch、DyNet、Chainer,而支持靜態(tài)圖計(jì)算的框架有TensorFlow,MXNet,Theano。        

Pytorch本質(zhì)上是支持GPU的Numpy替代,提供了用來(lái)創(chuàng)建和訓(xùn)練神經(jīng)網(wǎng)絡(luò) 的高級(jí)API。要想快速上手它,需要熟悉Numpy、Python和深度學(xué)習(xí)的一些基本概念。

2.學(xué)習(xí)途徑:        

目前網(wǎng)上關(guān)于Pytorch的教程真的是名目繁多,怎么選擇一個(gè)通俗易懂、系統(tǒng)化的的教程就顯得尤為重要。小編結(jié)合自身對(duì)Pytroch的學(xué)習(xí),以及對(duì)學(xué)習(xí)資源的篩選,下面為讀者提供一些專業(yè)的學(xué)習(xí)網(wǎng)站,希望可以方便大家更好的學(xué)習(xí)。       

1.Pytorch官網(wǎng):Pytorch官網(wǎng)可以直接百度:pytorch,第一個(gè)就是官方文檔。官網(wǎng)是對(duì)Pytorch最權(quán)威、最全面、最官方的解讀。常用的接口與功能在這里都可以找到對(duì)應(yīng)的說(shuō)明。平時(shí)多看看官方文檔,可以學(xué)到別的地方學(xué)不到的一些東西。        

2.github:  這是一個(gè)開(kāi)源的入門級(jí)的pytorch教程,簡(jiǎn)單,實(shí)用(由于公眾號(hào)文章不能引用外部鏈接,想要學(xué)習(xí)這個(gè)的話,直接復(fù)制路徑所有即可)        

3.莫煩Python:  直接百度莫煩Python,就可以找見(jiàn)。莫煩教程里面涵蓋了深度學(xué)習(xí)常用的框架視頻和代碼。小編自認(rèn)為這個(gè)教程最合適新手的入門,詳細(xì)的文檔、全面的視頻講解、還配備了對(duì)應(yīng)的視頻代碼,值得去系統(tǒng)的學(xué)習(xí)。

3.Pytorch的安裝:

Pytorch0.4.0之前只支持MacOS和Linux兩種系統(tǒng),并且支持多種安裝方式,Pytorch0.4.0之后開(kāi)始支持Windows系統(tǒng)。官網(wǎng)上介紹基于conda、pip和源碼編譯幾種不同的安裝方式。支持的版本有python2.7、python3.5和python3.6。鑒于深度學(xué)習(xí)需要的計(jì)算一般比較大,強(qiáng)烈建議找一個(gè)獨(dú)立顯卡的電腦展開(kāi)學(xué)習(xí),當(dāng)然要是沒(méi)有顯卡,就是計(jì)算速度會(huì)大大降低。小編安裝了一個(gè)Ubuntun16.04的雙系統(tǒng),而且本機(jī)沒(méi)有顯卡,所以環(huán)境的搭建與后邊代碼都是基于CPU下Ubuntu完成的。由于已經(jīng)習(xí)慣了使用  mkvirtulenv來(lái)管理自己的環(huán)境(conda可以下載非python的安裝包,當(dāng)前這個(gè)環(huán)境所使用的包都是python包,所以在這個(gè)環(huán)境里兩者無(wú)差別)。環(huán)境搭建提供mkvirtulenv和conda兩種安裝方式。

下面這個(gè)圖來(lái)源屬于Pytorch官網(wǎng),操作系統(tǒng)、安裝包管理工具、Python版本和CUDA分別可以根據(jù)自己的電腦配置來(lái)選擇

1. Introduction to pytoch:

Pytorch is a framework used for deep learning in Python. It can realize tensor and dynamic neural network on the basis of powerful GPU acceleration. If there is no GPU, it also supports CPU version. One of its advantages is the dynamic computing feature, that is, the computing graph is created at run time. At present, pytoch, dynet and chainer are the frameworks that support dynamic computing in the market, while tensorflow, mxnet and theano are the frameworks that support static graph computing.        

Pytoch is essentially a numpy alternative to GPU, providing a high-level API for creating and training neural networks. To get started quickly, you need to be familiar with some basic concepts of numpy, Python and deep learning.

2. Learning approach:

At present, there are many online tutorials about pytoch. How to choose an easy to understand and systematic tutorial is particularly important. In combination with my own learning of pytroch and the screening of learning resources, the editor will provide readers with some professional learning websites, hoping to facilitate everyone's better learning.        

1. Pytorch official website: pytorch official website can be directly Baidu: pytorch. The first is the official documents. The official website is the most authoritative, comprehensive and official interpretation of pytoch. The corresponding descriptions of common interfaces and functions can be found here. You can learn something you can't learn elsewhere by reading more official documents.         

2.github: this is an open source entry-level pytorch tutorial, which is simple and practical (since the official account article cannot quote external links, if you want to learn this, you can directly copy all the paths)

3. Don't bother Python: don't bother Python directly in Baidu, and you can find it. Don't bother the tutorial, which covers the framework videos and code commonly used for in-depth learning. Xiaobian thinks that this tutorial is the most suitable for beginners. The detailed documents, comprehensive video explanations, and the corresponding video code are also equipped, which is worth studying systematically.

3. Pytoch installation:

Before pytorch0.4.0, only MacOS and Linux systems were supported, and multiple installation methods were supported. After pytorch0.4.0, Windows systems were supported. Several different installation methods based on CONDA, PIP and source code compilation are introduced on the official website. Supported versions are python2.7, python3.5, and python3.6. In view of the large amount of computing required for deep learning, it is strongly recommended to find a computer with an independent graphics card to learn. Of course, if there is no graphics card, the computing speed will be greatly reduced. Xiaobian has installed a dual system of ubuntun16.04, and the machine has no graphics card, so the construction of the environment and the subsequent code are based on Ubuntu under CPU. Because you are used to using mkvirtulenv to manage your environment (CONDA can download non Python installation packages. Currently, the packages used in this environment are Python packages, so there is no difference between the two in this environment). Environment setup provides mkvirtulenv and CONDA installation methods.

The source of the following figure belongs to the pytoch official website. The operating system, installation package management tool, python version and CUDA can be selected according to their own computer configuration


桑植县| 普格县| 泽州县| 湟中县| 大关县| 孝义市| 柏乡县| 安丘市| 兰考县| 合作市| 陆河县| 新丰县| 光泽县| 新余市| 聂拉木县| 南宁市| 彰化市| 京山县| 卢氏县| 邛崃市| 托克托县| 融水| 吉首市| 环江| 安国市| 陈巴尔虎旗| 紫云| 谢通门县| 涪陵区| 易门县| 贵德县| 罗江县| 江安县| 宁远县| 开平市| 义马市| 双鸭山市| 德化县| 罗源县| 都江堰市| 达孜县|