Skip to content

Commit

Permalink
Adding Jupyter Book to deploy this course as a website
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyashguptas committed Nov 13, 2024
1 parent 31de883 commit 0b341b4
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.conda
.venv/
.venv/
_build/
.DS_Store
__pycache__/
.ipynb_checkpoints/
17 changes: 17 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Book settings
title: Learning Deep Learning with Analogies
author: Shreyash Gupta
copyright: "2024"
logo: images/your-logo.png # Add a logo image if you have one

# Force re-execution of notebooks on each build
execute:
execute_notebooks: force

repository:
url: https://github.com/shreyashgupta/Machine-Learning-Explained-With-Analogies
branch: main

html:
use_issues_button: true
use_repository_button: true
7 changes: 7 additions & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
format: jb-book
root: index
chapters:
- file: notebooks/deep-learning/Introduction to Deep Learning with PyTorch
title: Introduction to Deep Learning
- file: notebooks/supervised-learning/code-file
title: Supervised Learning
72 changes: 72 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Learning Deep Learning with Analogies 🧠

Ever felt overwhelmed by Machine Learning jargon? We get it! This course explains Deep Learning concepts using simple analogies and practical code examples using PyTorch.

## Why This Course? 🤔

Learning Machine Learning and Deep Learning can be tough. While there are many great resources out there, we believe the best way to learn is through:
- Simple analogies that relate to everyday life
- Clear explanations of why we do what we do
- Hands-on coding examples
- No complicated math (just the essential concepts)

## What Makes This Course Different? 💡

- **Everything explained with analogies**: Complex topics broken down using real-world examples
- **Beginner-friendly**: No prior Machine Learning/Deep Learning knowledge needed
- **Learn by doing**: Practical code examples and exercises
- **AI-assisted learning**: Recommended use of AI chat tools (like Perplexity) when stuck

## Prerequisites 📚

- Basic Python programming knowledge
- Ability to run Python code (locally or using cloud platforms like Google Colab)
- Curiosity to learn!

## Course Content 📖 (Needs to be updated once the notebooks are finished)

### Machine Learning Fundamentals
- Linear Regression: Your First ML Model
- Gradient Descent: How Models Learn
- Normal Equations: A Different Approach

### Deep Learning Journey
- PyTorch Basics: Your New ML Friend
- Neural Networks: Building Blocks
- Convolutional Neural Networks (CNNs): Image Processing Magic
- Recurrent Neural Networks (RNNs): Understanding Sequences

## How to Use This Course 🎯

1. Go to the notebooks folder and open the notebook that you want to learn from
2. Read every piece of text carefully and then run the code that you see below it oftentimes just write the code again yourself just type it out as you see above and run it yourself.

## Getting Help 🆘

- **Stuck on a concept?** Use AI chat tools for personalized analogies
- **Found an issue?** Create a new issue in this repository
- **Need visual learning?** Check out [Amazon's MLU-Explain](https://mlu-explain.github.io/)

## Contributing 🤝

This is an open-source project! Feel free to:
- Suggest better analogies
- Add new examples
- Fix errors
- Share your learning experience

## Start Learning! 🚀

Ready to begin? Head to the first notebook in the `notebooks` folder!

---

Remember: Everyone learns differently. If this approach doesn't click with you, that's okay! Check out other resources like MLU-Explain for visual learning.



----

# Additional things to add.
### 1. How do I know this is the right course for me to do?
### (...)
Original file line number Diff line number Diff line change
Expand Up @@ -3733,6 +3733,96 @@
"Remember: Just like becoming a good skier requires practice and adjusting your technique based on the slope, finding the right learning rate and momentum often requires experimentation based on your specific model and data. Start conservative (lower learning rate, moderate momentum) and adjust based on how your model performs!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Exercise\n",
"\n",
"Experimenting with learning rate\n",
"In this exercise, your goal is to find the optimal learning rate such that the optimizer can find the minimum of the non-convex function x^4 + x^3 - 5x^2 in ten steps.\n",
"\n",
"You will experiment with three different learning rate values. For this problem, try learning rate values between 0.001 to 0.1.\n",
"\n",
"You are provided with the optimize_and_plot() function that takes the learning rate for the first argument. This function will run 10 steps of the SGD optimizer and display the results."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Instructions (1/3)\n",
"\n",
"- Try a small learning rate value such that the optimizer isn't able to get past the first minimum on the right."
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
"# # Try a first learning rate value\n",
"# lr0 = 0.005\n",
"# optimize_and_plot(lr=lr0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Instructions (1/3)\n",
"\n",
"- Try a large learning rate value such that the optimizer skips past the global minimum at -2."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Exercise\n",
"\n",
"### Experimenting with momentum\n",
"\n",
"- In this exercise, your goal is to find the optimal momentum such that the optimizer can find the minimum of the following non-convex function in 20 steps. You will experiment with two different momentum values. For this problem, the learning rate is fixed at 0.01.\n",
"\n",
"You are provided with the optimize_and_plot() function that takes the learning rate for the first argument. This function will run 20 steps of the SGD optimizer and display the results."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Instructions (1/2)\n",
"\n",
"- Try a first value for the momentum such that the optimizer gets stuck in the first minimum."
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"# # Try a first value for momentum\n",
"# mom0 = 0\n",
"# optimize_and_plot(momentum=mom0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Instructions (2/2)\n",
"\n",
"- Try a second value for momentum such that the optimizer finds the global optimum."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
7 changes: 6 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@ tornado==6.4.1
traitlets==5.14.3
typing_extensions==4.12.2
tzdata==2024.2
wcwidth==0.2.13
wcwidth==0.2.13


jupyter-book>=0.13.0
ghp-import
sphinx>=4.0

0 comments on commit 0b341b4

Please sign in to comment.