Skip to content

Commit

Permalink
correct PyTorch spelling in documentation and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SkafteNicki committed Nov 8, 2024
1 parent 87a5696 commit 4be4844
Show file tree
Hide file tree
Showing 23 changed files with 102 additions and 100 deletions.
2 changes: 1 addition & 1 deletion pages/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ probabilities are, what a classifier is, what overfitting means etc. This corres
course [02450](https://kurser.dtu.dk/course/02450). The actual focus of the course is not on machine learning models,
but we will be using these basic concepts throughout the exercises.

Additionally, we recommend basic knowledge about deep learning and how to code in [Pytorch](https://pytorch.org/),
Additionally, we recommend basic knowledge about deep learning and how to code in [PyTorch](https://pytorch.org/),
corresponding to the curriculum covered in [02456](https://kurser.dtu.dk/course/02456). From prior experience, we know
that not all students have gained knowledge about deep learning models before this course, and we will be covering the
basics of how to code in PyTorch in one of the
Expand Down
4 changes: 2 additions & 2 deletions pages/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ a different stack of tools that better fits your needs. Regardless of the stack,

| Framework | Description |
|-----------|-------------|
| ![Pytorch](../figures/icons/pytorch.png){ width="50" } | **Pytorch** is the backbone of our code, it provides the computational engine and the data structures that we need to define our data structures. |
| ![Pytorch Lightning](../figures/icons/lightning.png){ width="50" } | **Pytorch lightning** is a framework that provides a high-level interface to Pytorch. It provides a lot of functionality that we need to train our models, such as logging, checkpointing, early stopping, etc. such that we do not have to implement it ourselves. It also allows us to scale our models to multiple GPUs and multiple nodes. |
| ![PyTorch](../figures/icons/pytorch.png){ width="50" } | **PyTorch** is the backbone of our code, it provides the computational engine and the data structures that we need to define our data structures. |
| ![PyTorch Lightning](../figures/icons/lightning.png){ width="50" } | **PyTorch lightning** is a framework that provides a high-level interface to PyTorch. It provides a lot of functionality that we need to train our models, such as logging, checkpointing, early stopping, etc. such that we do not have to implement it ourselves. It also allows us to scale our models to multiple GPUs and multiple nodes. |
| ![Conda](../figures/icons/conda.png){ width="50" } | We control the dependencies and Python interpreter using **Conda** that enables us to construct reproducible virtual environments |
| ![Hydra](../figures/icons/hydra.png){ width="50" } | For configuring our experiments we use **Hydra** that allows us to define a hierarchical configuration structure config files |
| ![Wandb](../figures/icons/w&b.png){ width="50" } | Using **Weights and Bias** allows us to track and log any values and hyperparameters for our experiments |
Expand Down
14 changes: 7 additions & 7 deletions pages/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ group yet.
We strive to keep the tools thought in this course as open-source as possible. The great thing about the open-source
community is that whatever problem you are working on, there is probably some package out there that can get you
at least 10% of the way. For the project, we want to enforce this point and you are required to include some third-party
package, that is neither Pytorch or one of the tools already covered in the course, into your project.
package, that is neither PyTorch or one of the tools already covered in the course, into your project.

If you have no idea what framework to include, the [Pytorch ecosystem](https://pytorch.org/ecosystem/) is a great place
for finding open-source frameworks that can help you accelerate your own projects where Pytorch is the backengine. All
tools in the ecosystem should work greatly together with Pytorch. However, it is important to note that the ecosystem is
not a complete list of all the awesome packages that exist to extend the functionality of Pytorch. If you are still
If you have no idea what framework to include, the [PyTorch ecosystem](https://pytorch.org/ecosystem/) is a great place
for finding open-source frameworks that can help you accelerate your own projects where PyTorch is the backengine. All
tools in the ecosystem should work greatly together with PyTorch. However, it is important to note that the ecosystem is
not a complete list of all the awesome packages that exist to extend the functionality of PyTorch. If you are still
missing inspiration for frameworks to use, we highly recommend these three that have been used in previous years of the
course:

Expand All @@ -51,7 +51,7 @@ course:
texts such as classification, information extraction, question answering, summarization, translation, text generation,
etc in 100+ languages. Its aim is to make cutting-edge NLP easier to use for everyone.

* [Pytorch-Geometric](https://github.com/rusty1s/pytorch_geometric). PyTorch Geometric (PyG) is a geometric deep
* [PyTorch-Geometric](https://github.com/rusty1s/pytorch_geometric). PyTorch Geometric (PyG) is a geometric deep
learning. It consists of various methods for deep learning on graphs and other irregular structures, also known as
geometric deep learning, from a variety of published papers.

Expand Down Expand Up @@ -188,7 +188,7 @@ point on the checklist for the exam.
you can optimize your code
* [ ] Use Weights & Biases to log training progress and other important metrics/artifacts in your code. Additionally,
consider running a hyperparameter optimization sweep.
* [ ] Use Pytorch-lightning (if applicable) to reduce the amount of boilerplate in your code
* [ ] Use PyTorch-lightning (if applicable) to reduce the amount of boilerplate in your code

### Week 2

Expand Down
4 changes: 2 additions & 2 deletions pages/timeplan.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ especially with a focus on making everything reproducible.

Date | Day | Presentation topic | Frameworks | Format
-----|-----------|--------------------------------------------------------------------|--------------------------------------|-----------
6/1/25 | Monday | [Deep learning software📝](../slides/DeepLearningSoftware.pdf) | Terminal, Conda, IDE, Pytorch | [Exercises](../s1_development_environment/README.md)
6/1/25 | Monday | [Deep learning software📝](../slides/DeepLearningSoftware.pdf) | Terminal, Conda, IDE, PyTorch | [Exercises](../s1_development_environment/README.md)
7/1/25 | Tuesday | [MLOps: what is it?📝](../slides/IntroToMLOps.pdf) | Git, CookieCutter, Pep8, DVC | [Exercises](../s2_organisation_and_version_control/README.md)
8/1/25 | Wednesday | [Reproducibility📝](../slides/ReproducibilityAndSoftware.pdf) | Docker, Hydra | [Exercises](../s3_reproducibility/README.md)
9/1/25 | Thursday | [Debugging📝](../slides/DebuggingML.pdf) | Debugger, Profiler, Wandb, Lightning | [Exercises](../s4_debugging_and_logging/README.md)
Expand Down Expand Up @@ -60,7 +60,7 @@ important topic if we ever want our applications to be used by many people at th
Date | Day | Presentation topic | Frameworks | Format
-----|-----------|--------------------------------------------------------------|------------------------------------------|----------
20/1/25 | Monday | [Monitoring📝](../slides/Monitoring.pdf) | Evidently AI, Prometheus, GCP Monitoring | [Exercises](../s8_monitoring/README.md)
21/1/25 | Tuesday | [Scalable applications📝](../slides/ScalingApplications.pdf) | Pytorch, Lightning | [Exercises](../s9_scalable_applications/README.md)
21/1/25 | Tuesday | [Scalable applications📝](../slides/ScalingApplications.pdf) | PyTorch, Lightning | [Exercises](../s9_scalable_applications/README.md)
22/1/25 | Wednesday | Company presentation (TBA) | - | [Projects](projects.md)
23/1/25 | Thursday | No lecture | - | [Projects](projects.md)
24/1/25 | Friday | No lecture | - | [Projects](projects.md)
2 changes: 1 addition & 1 deletion reports/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ curriculum in this course. Therefore, we do not expect at all that you have chec
you can optimize your code
* [ ] Use Weights & Biases to log training progress and other important metrics/artifacts in your code. Additionally,
consider running a hyperparameter optimization sweep.
* [ ] Use Pytorch-lightning (if applicable) to reduce the amount of boilerplate in your code
* [ ] Use PyTorch-lightning (if applicable) to reduce the amount of boilerplate in your code

### Week 2

Expand Down
2 changes: 1 addition & 1 deletion s10_extra/high_performance_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ of cluster. For the purpose of this exercise we are going to see how we can run
1. First we need to load the correct version of CUDA. A cluster system often contains multiple versions of specific
software to suit the needs of all their users, and it is the users that are in charge of *loading* the correct
software during job submission. The only extra software that needs to be loaded for most Pytorch applications
software during job submission. The only extra software that needs to be loaded for most PyTorch applications
are a CUDA module. You can check which modules are available on the cluster with
```bash
Expand Down
2 changes: 1 addition & 1 deletion s10_extra/quantization.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ after training. There are good reasons for doing both:
??? success "Solution"
We are here going to assume that you are either loading from a `onnx` model or alternatively loading a Pytorch
We are here going to assume that you are either loading from a `onnx` model or alternatively loading a PyTorch
Lightning checkpoint:
```python
Expand Down
2 changes: 1 addition & 1 deletion s1_development_environment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

- ![](../figures/icons/pytorch.png){align=right : style="height:100px;width:100px"}

Refresh your Pytorch skills and implement a simple deep-learning model.
Refresh your PyTorch skills and implement a simple deep-learning model.

[:octicons-arrow-right-24: M4: Deep Learning Software](deep_learning_software.md)

Expand Down
26 changes: 13 additions & 13 deletions s1_development_environment/deep_learning_software.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ of when they were published):
![Logo](../figures/pytorch.png){ align=right width="130"}
![Logo](../figures/jax.png){ align=right width="200"}

* [Tensorflow](https://github.com/tensorflow/tensorflow)
* [TensorFlow](https://github.com/tensorflow/tensorflow)

* [Pytorch](https://github.com/pytorch/pytorch)
* [PyTorch](https://github.com/pytorch/pytorch)

* [JAX](https://github.com/google/jax)

We won't go into a longer discussion on which framework is best, as it is pointless. Pytorch and Tensorflow have been
We won't go into a longer discussion on which framework is best, as it is pointless. PyTorch and TensorFlow have been
around for the longest and therefore have bigger communities and feature sets at this point in time. They are both very
similar in the sense that they both have features directed against research and production. JAX is kind of the new kid
on the block, which in many ways improves on Pytorch and Tensorflow, but is still not as mature as the other frameworks.
on the block, which in many ways improves on PyTorch and TensorFlow, but is still not as mature as the other frameworks.
As the frameworks use different kinds of programming principles (object-oriented vs. functional programming), comparing
them is essentially meaningless.

In this course, we have chosen to work with Pytorch because we find it a bit more intuitive and it is the framework that
In this course, we have chosen to work with PyTorch because we find it a bit more intuitive and it is the framework that
we use for our day-to-day research life. Additionally, as of right now, it is absolutely the
[dominating framework](https://www.assemblyai.com/blog/pytorch-vs-tensorflow-in-2022/) for published models, research
papers, and [competition winners](https://blog.mlcontests.com/p/winning-at-competitive-ml-in-2022?s=w).

The intention behind this set of exercises is to bring everyone's Pytorch skills up to date. If you already are a
Pytorch-Jedi, feel free to pass the first set of exercises, but I recommend that you still complete it. The exercises
The intention behind this set of exercises is to bring everyone's PyTorch skills up to date. If you already are a
PyTorch-Jedi, feel free to pass the first set of exercises, but I recommend that you still complete it. The exercises
are, in large part, taken directly from the
[deep learning course at Udacity](https://github.com/udacity/deep-learning-v2-pytorch). Note that these exercises are
given as notebooks, which is the last time we are going to use them actively in the course. Instead, after this set of
Expand Down Expand Up @@ -81,13 +81,13 @@ important to have a basic understanding of the concepts.
[here](https://code.visualstudio.com/docs/datascience/jupyter-notebooks)

2. Complete the
[Tensors in Pytorch](https://github.com/SkafteNicki/dtu_mlops/tree/main/s1_development_environment/exercise_files/1_Tensors_in_PyTorch.ipynb)
notebook. It focuses on the basic manipulation of Pytorch tensors. You can pass this notebook if you are comfortable
[Tensors in PyTorch](https://github.com/SkafteNicki/dtu_mlops/tree/main/s1_development_environment/exercise_files/1_Tensors_in_PyTorch.ipynb)
notebook. It focuses on the basic manipulation of PyTorch tensors. You can pass this notebook if you are comfortable
doing this.

3. Complete the
[Neural Networks in Pytorch](https://github.com/SkafteNicki/dtu_mlops/tree/main/s1_development_environment/exercise_files/2_Neural_Networks_in_PyTorch.ipynb)
notebook. It focuses on building a very simple neural network using the Pytorch `nn.Module` interface.
[Neural Networks in PyTorch](https://github.com/SkafteNicki/dtu_mlops/tree/main/s1_development_environment/exercise_files/2_Neural_Networks_in_PyTorch.ipynb)
notebook. It focuses on building a very simple neural network using the PyTorch `nn.Module` interface.

4. Complete the
[Training Neural Networks](https://github.com/SkafteNicki/dtu_mlops/tree/main/s1_development_environment/exercise_files/3_Training_Neural_Networks.ipynb)
Expand Down Expand Up @@ -147,7 +147,7 @@ important to have a basic understanding of the concepts.
sum([prod(p.shape) for p in neural_net.parameters()])
```

3. A working training loop in Pytorch should have these three function calls: `optimizer.zero_grad()`,
3. A working training loop in PyTorch should have these three function calls: `optimizer.zero_grad()`,
`loss.backward()`, `optimizer.step()`. Explain what would happen in the training loop (or implement it) if you
forgot each of the function calls.

Expand Down Expand Up @@ -222,7 +222,7 @@ future as you start to add more and more features. As subgoals, please fulfill t

1. :man_raising_hand: The `.pt` files are nothing else than a `.pickle` file in disguise. The
`torch.save/torch.load` function is essentially a wrapper around the `pickle` module in Python, which
produces serialized files. However, it is convention to use `.pt` to indicate that the file contains Pytorch
produces serialized files. However, it is convention to use `.pt` to indicate that the file contains PyTorch
tensors.

We have additionally in the solution added functionality for plotting the images together with the labels for
Expand Down
6 changes: 3 additions & 3 deletions s3_reproducibility/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,17 +395,17 @@ beneficial for you to download.
If it does not work, try redoing the steps.
3. We should hopefully have a working setup now for running Nvidia accelerated docker containers. The next step is
to get Pytorch inside our container, such that our Pytorch implementation also correctly identifies the GPU.
to get PyTorch inside our container, such that our PyTorch implementation also correctly identifies the GPU.
Luckily for us, Nvidia provides a set of docker images for GPU-optimized software for AI, HPC and visualizations
through their [NGC Catalog](https://docs.nvidia.com/ngc/ngc-catalog-user-guide/index.html#what-is-nvidia-ngc).
The containers that have to do with Pytorch can be seen
The containers that have to do with PyTorch can be seen
[here](https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/index.html). Try pulling the latest:
```bash
docker pull nvcr.io/nvidia/pytorch:22.07-py3
```
It may take some time because the NGC images include a lot of other software for optimizing Pytorch
It may take some time because the NGC images include a lot of other software for optimizing PyTorch
applications. It may be possible for you to find other images for running GPU-accelerated applications that have
a smaller memory footprint, but NGC is the recommended and supported way.
Expand Down
2 changes: 1 addition & 1 deletion s3_reproducibility/exercise_files/vae_mnist.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Adapted from https://github.com/Jackson-Kang/Pytorch-VAE-tutorial/blob/master/01_Variational_AutoEncoder.ipynb.
"""Adapted from https://github.com/Jackson-Kang/PyTorch-VAE-tutorial/blob/master/01_Variational_AutoEncoder.ipynb.
A simple implementation of Gaussian MLP Encoder and Decoder trained on MNIST
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Adapted from https://github.com/Jackson-Kang/Pytorch-VAE-tutorial/blob/master/01_Variational_AutoEncoder.ipynb.
"""Adapted from https://github.com/Jackson-Kang/PyTorch-VAE-tutorial/blob/master/01_Variational_AutoEncoder.ipynb.
A simple implementation of Gaussian MLP Encoder and Decoder trained on MNIST
"""
Expand Down
Loading

0 comments on commit 4be4844

Please sign in to comment.