Skip to content

realcwj/LearningNeuralNetwork

Repository files navigation

Important

This project is prohibited to use for commercial purposes! If needed, please contact me.
禁止商业使用!如有需要请联系作者。
尤其是中国大陆某些“十块钱学透深度学习”等所谓“教育机构”!

For reprinting, please indicate the author's information
转载请注明作者信息,谢谢!
尤其是抖音(特别是中国大陆地区)、快手等短视频平台

In the future, I will try my best to use English comments in the code. For some Chinese comments in my previous code, please use translation software, I'm sorry for that. :(

Introduce

This is a repository which documents my learning experience in Deep Learning. The programming language is Python.

You might be wondering how AMD GPU (even doesn't support RoCm) works for deep learning? But in fact this is possible, the principle is to use Microsoft DirectX 12 (DirectML), You can read this: Enable PyTorch with DirectML on Windows.

So all graphics cards that support DirectX 12 can run the deep learning framework. :)

For some projects with low performance requirements, I use CPU for calculation, and the others I use "dml" (AMD GPU) or "cuda" (Nvidia GPU).

Environment

All the codes are confirmed to work on my computer.

Item Info
System Windows 11 Build 25126
Windows 2019 DataCenter
CPU AMD Ryzen7 2700X
GPU AMD Radeon RX580 8G
Nvidia Tesla V100
Nvidia Tesla T4
Python Version Python 3.8 (dml)
Python 3.10 (cpu,cuda)
PyTorch Version PyTorch 1.8 (dml)
PyTorch 1.11 (cpu,cuda)
IDE Microsoft Visual Stuido Code - Insiders

*Please install MiniConda by yourself.

Devices

Just modify torch.device("xxx") in the code.

device name
CPU "cpu"
AMD GPU "dml"
Nvidia GPU "cuda"

Install PyTorch

*For Nvidia GPU/CPU, go to this page: Install PyTorch, install PyTorch as normal.

For AMD GPU, the directml only supports PyTorch 1.8, and Python 3.8.

*DO NOT USE pip install pytorch

The following command are all copied from Microsoft Docs.

conda create --name pydml -y
conda activate pydml
conda install -c anaconda python=3.8 -y
conda install -n pydml pandas -y
conda install -n pydml tensorboard -y
conda install -n pydml matplotlib -y
conda install -n pydml tqdm -y
conda install -n pydml pyyaml -y
pip install opencv-python
pip install wget
pip install torchvision==0.9.0
pip install pytorch-directml

For testing, use:

import torch
tensor1 = torch.tensor([1]).to("dml")
tensor2 = torch.tensor([2]).to("dml")
dml_algebra = tensor1 + tensor2
dml_algebra.item()

If installed well, the program will be like this:

>>> import torch
>>> tensor1 = torch.tensor([1]).to("dml")
>>> tensor2 = torch.tensor([2]).to("dml")
>>> dml_algebra = tensor1 + tensor2
>>> dml_algebra.item()
3

Notes

Learning Order File Name Notes
0 BasicFunctions Learning some basic operations of torch.tensor.
1 线性回归 The most basic framework.
2 FNN-MNIST Add some functions, and try to recognize handwrite numbers.
3 CNN-MNIST Learn CNN (Convolutional Neural Networks)
4 CNN-FashionMNIST Apparel classification problem using CNN
5 CNN-CIFAR10 (NOT FINISHED) Object Recognition Based on CNN VGG16 Model

Contact

Please contact me if you have any problems.
Both emails are available, please make sure that emails sent from these two are not listed as spam.
founder@imcwj.cn
imcwj@stu.ahau.edu.cn
I will reply you soon!
I'm Wenjun Chen, glad to chat with you :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published