This repository is designed to help me learn PyTorch from the ground up, with hands-on examples and progressive tutorials. All from freecodecamp and the PyTorch docs!
- Python 3.8 or higher
- pip or conda package manager
-
Clone or download this repository
git clone <your-repo-url> cd pytorch_study
-
Create a virtual environment (recommended)
# Using venv python -m venv pytorch_env # Activate the environment # On Windows: pytorch_env\Scripts\activate # On macOS/Linux: source pytorch_env/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Verify installation
python -c "import torch; print(f'PyTorch version: {torch.__version__}')"
pytorch_study/
├── notebooks/ # Jupyter notebooks for learning
│ ├── 01_pytorch_basics.ipynb
│ ├── 02_neural_networks.ipynb
│ ├── 03_computer_vision.ipynb
│ └── 04_natural_language_processing.ipynb
├── data/ # Datasets and data files
├── models/ # Saved model checkpoints
├── utils/ # Utility functions and helpers
├── examples/ # Standalone example scripts
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore rules
└── README.md # This file
- Tensors and operations
- Automatic differentiation
- Basic neural network construction
- Training loops
- Building different types of neural networks
- Convolutional Neural Networks (CNNs)
- Recurrent Neural Networks (RNNs)
- Transfer learning
- Image preprocessing and augmentation
- CNN architectures
- Object detection
- Image segmentation
- Text preprocessing
- Word embeddings
- RNNs and LSTMs for NLP
- Transformer models
-
Start Jupyter Notebook
jupyter notebook
-
Or start JupyterLab (recommended)
jupyter lab
-
Navigate to the
notebooks/folder and start with01_pytorch_basics.ipynb
- Start with the basics: Work through the notebooks in order
- Experiment: Modify the code, try different parameters
- Practice: Create your own small projects
- Read the documentation: PyTorch docs are excellent
- Join the community: PyTorch forums and Discord are great resources
import torch
print(f"PyTorch version: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")import torch
x = torch.tensor([1, 2, 3, 4])
print(x)import torch.nn as nn
class SimpleNet(nn.Module):
def __init__(self):
super(SimpleNet, self).__init__()
self.fc = nn.Linear(10, 1)
def forward(self, x):
return self.fc(x)
model = SimpleNet()- PyTorch Official Tutorials
- PyTorch Documentation
- Deep Learning with PyTorch Book
- PyTorch Examples on GitHub
Feel free to:
- Add your own examples
- Improve existing notebooks
- Fix bugs or typos
- Suggest new topics
This project is for educational purposes. Feel free to use and modify as needed.
Happy learning! 🎉 If you have any questions, don't hesitate to ask or check the PyTorch community forums.