# Week 2 - Introduction to PyTorch

### This week you will...

* get an introduction into PyTorch and how to build a model using the right PyTorch classes
* you will also learn how to train a model over several epochs and how non-linear activation functions increase the expressive power of neural networks, allowing them to learn non-linear relationships in the data
* the course material also includes a section how the shapes of the learnable parameters (weights and biases) of a PyTorch model translate into the mathematical expressions PyTorch applies under the hood

### Learning Resources

{% file src="/files/tpSF8IB5G91t3KLX4W8j" %}

* [Machine Learning Explained in 100 Seconds](https://www.youtube.com/watch?v=PeMlggyqz0Y) (Fireship, 2:30 min)
* [Backpropagation, intuitively | Deep Learning Chapter 3](https://www.youtube.com/watch?v=Ilg3gGewQ5U\&list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi\&index=4) (3Blue1Brown, 13 min)\
  How the parameters of the model influence the prediction quality and how **Backpropagation** uses the gradients of the **Cost Function** (also known as the **Loss Function**) to update the weights and biases
* [What is a Loss Function? Understanding How AI Models Learn](https://www.youtube.com/watch?v=v_ueBW_5dLg) (IBM Technology, 10 min)\
  How **Loss Functions** are used to quantify predictions and guide model training and which **Loss Function** to choose based on the data and task (**Regression** vs. **Classification**) at hand
* [Validation data: How it works and why you need it](https://www.youtube.com/watch?v=NPWlj9G1Si8) (Galaxy Inferno Codes, 5:40 min)\
  Why we need **Training**, **Validation** and **Test** datasets and what **Overfittting** and **Data Leakage** are&#x20;

**Additional Resources (going beyond this week's topics)**&#x20;

* [Parameters vs Hyperparameters](https://www.youtube.com/watch?v=32tNAhQ8x7M) (Pankaj Kumar Porwal, 5:40 min)\
  Discusses the difference between learnable **Parameters** (weights and biases) and **Hyperparameters** that are not learned, but specified when defining the model or training

### Until next week you should...&#x20;

* Complete [Module 3](https://learn.deeplearning.ai/specializations/pytorch-for-deep-learning-professional-certificate/lesson/bvvjkv/introduction-to-data-pipelines) and [Module 4](https://learn.deeplearning.ai/specializations/pytorch-for-deep-learning-professional-certificate/lesson/wrr1egt/cnns---part-1%3A-filters%2C-patterns%2C-and-feature-maps) of the first course "PyTorch: Fundamentals"
* Decide on a project for the course and form groups
* Complete the assignment in the following notebook:
  * [Assignment Notebook](https://colab.research.google.com/github/opencampus-sh/course-material/blob/main/applied-machine-learning/week-02/Week2_Notebook1_Ice_Cream_Sales_and_Image_Classification.ipynb)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://opencampus.gitbook.io/opencampus-machine-learning-program/courses/machine-learning-with-tensorflow/week-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
