brainstate

MorvanZhou/PyTorch-Tutorial · source

Snapshot 0 · 2026-11-04T12:47:24Z · Jupyter Notebook · MIT

Content fingerprintea91d0e6fae2c5da29dab7d62e676ce37945b4b62fd978f24ea7a5fda4c3404e

GitHub description at capture

Build your neural network easy and fast, 莫烦Python中文教学

README at capture

<p align="center">
    <a href="http://pytorch.org/" target="_blank">
    <img width="40%" src="logo.png" style="max-width:100%;">
    </a>
</p>


<br>

### If you'd like to use **Tensorflow**, no worries, I made a new **Tensorflow Tutorial** just like PyTorch. Here is the link: [https://github.com/MorvanZhou/Tensorflow-Tutorial](https://github.com/MorvanZhou/Tensorflow-Tutorial)

# pyTorch Tutorials

In these tutorials for pyTorch, we will build our first Neural Network and try to build some advanced Neural Network architectures developed recent years.

Thanks for [liufuyang's](https://github.com/liufuyang) [**notebook files**](tutorial-contents-notebooks)
which is a great contribution to this tutorial.

* pyTorch basic
  * [torch and numpy](tutorial-contents/201_torch_numpy.py)
  * [Variable](tutorial-contents/202_variable.py)
  * [Activation](tutorial-contents/203_activation.py)
* Build your first network
  * [Regression](tutorial-contents/301_regression.py)
  * [Classification](tutorial-contents/302_classification.py)
  * [An easy way](tutorial-contents/303_build_nn_quickly.py)
  * [Save and reload](tutorial-contents/304_save_reload.py)
  * [Train on batch](tutorial-contents/305_batch_train.py)
  * [Optimizers](tutorial-contents/306_optimizer.py)
* Advanced neural network
  * [CNN](tutorial-contents/401_CNN.py)
  * [RNN-Classification](tutorial-contents/402_RNN_classifier.py)
  * [RNN-Regression](tutorial-contents/403_RNN_regressor.py)
  * [AutoEncoder](tutorial-contents/404_autoencoder.py)
  * [DQN Reinforcement Learning](tutorial-contents/405_DQN_Reinforcement_learning.py)
  * [A3C Reinforcement Learning](https://github.com/MorvanZhou/pytorch-A3C)
  * [GAN (Generative Adversarial Nets)](tutorial-contents/406_GAN.py) / [Conditional GAN](tutorial-contents/406_conditional_GAN.py)
* Others (WIP)
  * [Why torch dynamic](tutorial-contents/501_why_torch_dynamic_graph.py)
  * [Train on GPU](tutorial-contents/502_GPU.py)
  * [Dropout](tutorial-contents/503_dropout.py)
  * [Batch Normalization](tutorial-contents/504_batch_normalization.py)

**For Chinese speakers: All methods mentioned below have their video and text tutorial in Chinese.
Visit [莫烦 Python](https://mofanpy.com/tutorials/) for more.
You can watch my [Youtube channel](https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg) as well.**


### [Regression](tutorial-contents/301_regression.py)

<a href="tutorial-contents/301_regression.py">
    <img class="course-image" src="https://mofanpy.com/static/results/torch/1-1-2.gif">
</a>

### [Classification](tutorial-contents/302_classification.py)

<a href="tutorial-contents/302_classification.py">
    <img class="course-image" src="https://mofanpy.com/static/results/torch/1-1-3.gif">
</a>

### [CNN](tutorial-contents/401_CNN.py)
<a href="tutorial-contents/401_CNN.py">
    <img class="course-image" src="https://mofanpy.com/static/results/torch/4-1-2.gif" >
</a>

### [RNN](tutorial-contents/403_RNN_regressor.py)

<a href="tutorial-contents/403_RNN_regressor.py">
    <img class="course-image" src="https://mofanpy.com/static/results/torch/4-3-1.gif" >
</a>

### [Autoencoder](tutorial-contents/404_autoencoder.py)

<a href="tutorial-contents/403_RNN_regressor.py">
    <img class="course-image" src="https://mofanpy.com/static/results/torch/4-4-1.gif" >
</a>

<a href="tutorial-contents/403_RNN_regressor.py">
    <img class="course-image" src="https://mofanpy.com/static/results/torch/4-4-2.gif" >
</a>

### [GAN (Generative Adversarial Nets)](tutorial-contents/406_GAN.py)
<a href="tutorial-contents/406_GAN.py">
    <img class="course-image" src="https://mofanpy.com/static/results/torch/4-6-1.gif" >
</a>

### [Dropout](tutorial-contents/503_dropout.py)
<a href="tutorial-contents/503_dropout.py">
    <img class="course-image" src="https://mofanpy.com/static/results/torch/5-3-1.gif" >
</a>

### [Batch Normalization](tutorial-contents/504_batch_normalization.py)
<a href="tutorial-contents/504_batch_normalization.py">
    <img class="course-image" src="https://mofanpy.com/static/results/torch/5-4-2.gif" >
</a>

# Donation

*If this does help you, please consider donating to support me for better tutorials. Any contribution is greatly appreciated!*

<div >
  <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=morvanzhou%40gmail%2ecom&amp;lc=C2&amp;item_name=MorvanPython&amp;currency_code=AUD&amp;bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">
    <img style="border-radius: 20px;  box-shadow: 0px 0px 10px 1px  #888888;"
         src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/silver-pill-paypal-44px.png"
         alt="Paypal"
         height="auto" ></a>
</div>

<div>
  <a href="https://www.patreon.com/morvan">
    <img src="https://mofanpy.com/static/img/support/patreon.jpg"
         alt="Patreon"
         height=120></a>
</div>