Skip to content

stephenbaek/padl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Physics-Aware Deep Learning

Lecture materials for the "Physics-Aware Deep Learning" course (Prof. Stephen Baek, University of Virginia)

Course Schedule

Session Lecture Slides Lab
Course Orientation slides -
Introduction to Neural Networks slides intro
Convolutional Neural Networks slides crack,
data
How to Train Convolutional Neural Networks slides autograd
Physics Informed Neural Networks slides harmonic,
heat
Neural Operators slides lab,
data
Physics-Aware Recurrent Convolutions slides lab
Deep Reduced Order Modeling slides -
Generative Networks and Digital Twins slides -

Get Started with Google Colab (Recommended)

The easiest way of getting started with the course materials, especially if you don't have much experience with Python and computer programming in general, would be to use what's called Google Colab.

Colab is essentially a Jupyter Notebook service hosted on Google's server, which requires no setup to use and provides free access to computing resources, especially CUDA-enabled GPUs. If you are a complete beginner or have no access to high-end NVIDIA GPUs, Colab is probably the best way of learning the course materials.

In case you are new to Python, Jupyter Notebook is an interactive Python environment you can run on a web browser. You can run Python scripts on a notebook, make notes, experiment with different implementations, etc. If you have not used Jupyter Notebook before, this tutorial might help you get started.

All lab sessions in this course are directly accessible from Google Colab. For each lab session file (*.ipynb), look for the Open in Colab badge at the top and just click it, which will let you open the lab session in Colab directly.

Get Started on Your Local Machine

Installing Anaconda/Miniconda

Anaconda and Miniconda are popular package managers for Python, especially for data science and machine learning. Anaconda comes with a large collection of pre-installed packages, while Miniconda provides a minimal setup with only essential tools. You just need to install both, but choose one you need.

Installing Miniconda (Recommended)

  1. Download Miniconda

  2. Run the Installer

    • On Windows, execute the downloaded .exe file and follow the instructions.
    • On macOS and Linux, run the following command in the terminal:
      bash Miniconda3-*.sh
    • Follow the prompts to complete the installation.
  3. Verify Installation

    • Open a terminal or command prompt and type below. If Miniconda is installed correctly, it will display the installed version.
      conda --version

Installing the Full Anaconda

  1. Download Anaconda

  2. Run the Installer

    • On Windows, run the .exe file and follow the installation prompts.
    • On macOS and Linux, run the .sh script in the terminal using:
      bash Anaconda3-*.sh
    • Follow the on-screen instructions.
  3. Verify Installation

    • Open a terminal or command prompt and type below. If Anaconda is installed correctly, it will display the installed version.
      conda --version

Post-Installation Setup (For both Miniconda and Anaconda)

Conda virtual environments allow users to create isolated Python environments with specific dependencies. This helps prevent conflicts between different packages and projects. Each environment can have its own Python version and set of libraries. Using Conda environments ensures a clean and manageable workspace for different projects.

  1. Create a virtual environment:

    conda create -n padl python=3.11 ipykernel
  2. Activate the environment:

    conda activate padl

Install PyTorch

PyTorch is a popular open-source machine learning framework used for deep learning applications. It provides dynamic computation graphs and GPU acceleration, making it a preferred choice for researchers and practitioners. Physics-aware deep learning community also widely adopts PyTorch for research.

The best and most reliable way to install PyTorch is by following their official documentation, which gets updated quite frequently.

Overall, the procedure should look something like this:

  1. Make sure you activated the environment (see "Post-Installation Setup" for Anaconda/Miniconda)

    conda activate padl
  2. Visit the Official Installation Guide

    • Go to the PyTorch website.
    • Select your operating system (OS), package manager (you can choose 'pip'), language ('Python'), and CUDA version (if using a GPU). If you don't have a CUDA-compatible GPU on your machine, choose 'CPU' instead of 'CUDA'.
  3. Install PyTorch

    • Once you have made selections on the official PyTorch website, it will generate a command for you to run. It should look something like this (but may vary according to your selection):
      pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
  4. Verify Installation

    • If PyTorch is correctly installed, the following command should display a version number:
      python -c "import torch; print(torch.__version__)"
    • Also, if you installed the GPU version with the 'CUDA' option, the following command should return "True":
      python -c "import torch; print(torch.cuda.is_available())"

Install dependencies

Finally, once you are done with installing PyTorch, run the following command to install the rest of the 3rd party libraries that are required for running the lab tutorials.

pip install -r requirements.txt

Run Notebooks

Materials for the lab sessions can be found under the ./labs folder of this repository. To run a notebook, you can type the following command:

jupyter notebook labs/<name-of-the-notebook>.ipynb

This will open up a web browser tab, in which you can interact with the codes. While the user interface of these notebooks are pretty straightforward, it wouldn't hurt to read this tutorial to get familiarize yourself with it.

About

Lecture materials for the "Physics-Aware Deep Learning" course (Prof. Stephen Baek, University of Virginia)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages