start adding annotations

This commit is contained in:
Daniel Bourke committed 2021-12-09 11:29:54 +10:00
1 parent eb32e60091
commit efec7ffc28
1 file changed
+67 -17
+67 -17
View File
@@ -18,30 +18,62 @@
"source": [
"# 00. PyTorch Fundamentals\n",
"\n",
"# TK - intro to PyTorch\n",
"\n",
"## TK - What is PyTorch?\n",
"\n",
"PyTorch is an open source machine learning and deep learning framework.\n",
"\n",
"## TK - What can PyTorch be used for?\n",
"\n",
"PyTorch allows you to manipulate and process data and write machine learning algorithms using Python code.\n",
"\n",
"## TK - Who uses PyTorch?\n",
"\n",
"Many of the worlds largest technology companies such as Meta (Facebook), Tesla and Microsoft as well as artificial intelligence research companies such as OpenAI use PyTorch to power research and bring machine learning to their products.\n",
"\n",
"For example, Andrej Karpathy (head of AI at Tesla) has given several talks ([PyTorch DevCon 2019](https://youtu.be/oBklltKXtDE), [Tesla AI Day 2021](https://youtu.be/j0z4FweCy4M?t=2904)) about how Tesla use PyTorch to power their self-driving computer vision models.\n",
"\n",
"## TK - Why use PyTorch?\n",
"\n",
"Researchers love using PyTorch -- https://paperswithcode.com/trends \n",
"Researchers love using PyTorch. Many of the latest machine learning research papers have [some kind of PyTorch code attached](https://paperswithcode.com/trends). \n",
"\n",
"PyTorch also helps take care of many things such as GPU acceleration (making your code run faster) behind the scenes. \n",
"\n",
"So you can focus on manipulating data and writing algorithms and PyTorch will make sure it runs fast.\n",
"\n",
"And if companies such as Tesla and Meta (Facebook) use it to build models they deploy to power hundreds of applications, drive thousands of cars and deliver content to billions of people, it's clearly capable on the development front too.\n",
"\n",
"## TK - What we're going to cover in this module...\n",
"\n",
"* Introduction to Tensors\n",
"* Creating tensors\n",
"* Getting information from tensors\n",
"* Manipulating tensors\n",
"* Tensor operations (neural networks involve manipulating tensors...)\n",
"* Tensors and NumPy\n",
"* Running tensors on GPU\n",
"This course is broken down into different sections (notebooks). \n",
"\n",
"Each notebook covers important ideas and concepts within PyTorch.\n",
"\n",
"\n"
"Subsequent notebooks build upon knowledge from the previous one.\n",
"\n",
"This notebook deals with the basic building block of machine learning and deep learning, the tensor.\n",
"\n",
"Specifically, we're going to cover:\n",
"\n",
"* **Introduction to tensors** - Tensors are the basic building block of all of machine learning and deep learning.\n",
" * **Creating tensors** - Tensors can represent almost any kind of data (images, words, tables of numbers).\n",
" * **Getting information from tensors** - If you can put information into a tensor, you'll want to get it out too.\n",
"* **Manipulating tensors** - Machine learning algorithms (like neural networks) involve manipulating tensors in many different ways such as adding, multiplying, combining.\n",
"* **Dealing with tensor shapes** - One of the most common issues in machine learning is dealing with shape mismatches (trying to mixed wrong shaped tensors with other tensors).\n",
"* **Indexing on tensors** - If you've indexed on a Python list or NumPy array, it's very similar with tensors, except they can have far more dimensions. \n",
"* **Mixing PyTorch tensors and NumPy** - PyTorch plays with tensors ([`torch.Tensor`](https://pytorch.org/docs/stable/tensors.html)), NumPy likes arrays ([`np.ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html)) sometimes you'll want to mix and match these.\n",
"* **Reproducibility** - Machine learning is very experimental and since it uses a lot of *randomness* to work, sometimes you'll want that *randomness* to not be so random. \n",
"* **Running tensors on GPU** - GPUs (Graphics Processing Units) make your code faster, PyTorch makes it easy to run your code on GPUs.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## TK - Importing PyTorch\n",
"\n",
"> **Note:** Before running any of the code in this notebook, you should have gone through the PyTorch setup steps (TK-setup steps link). However, if you're running on Google Colab, everything should work (Google Colab comes with PyTorch and other libraries installed).\n",
"\n",
"UPTOHERE, setup etc etc"
]
},
{
@@ -56,16 +88,19 @@
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1.10.0\n"
]
"data": {
"text/plain": [
"'1.10.0'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import torch\n",
"print(torch.__version__)"
"torch.__version__"
]
},
{
@@ -2235,6 +2270,21 @@
"* add in scatter (for changing values)\n",
"* go back through headings and make sure cells are complete \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## TK - Exercises\n",
"## TK - Extra-curriculum\n",
"\n",
"* to learn more on how a tensor can represent data, see this video: [What's a tensor?](https://youtu.be/f5liqUk0ZTw)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {