Skip to content

Simple tutorial on Physics Informed Machine Learning

Notifications You must be signed in to change notification settings

g-pa/piml-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Physics Informed Machine Learning tutorial

This repository contains the code for a tutorial on Physics Informed Machine Learning (PIML) and Neural Networks.
This is strongly inspired by famous Ben Moseley post and demonstrates how to incorporate physical laws into machine learning models to improve predictions and interpretability.


Repository Structure

.
├── .env.template
├── .gitignore
├── .python-version
├── pyproject.toml
├── README.md
├── uv.lock
├── notebooks/
│   └── 0 Inertial Oscillator.ipynb
└── src/
    ├── models.py
    ├── utils.py
    └── physics/
        └── inertial_oscillator.py
  • notebooks/ – Jupyter notebooks demonstrating tutorial examples.
  • src/models.py – Neural network models.
  • src/utils.py – Utility functions.
  • src/physics/ – Physics-informed functions for modeling systems (e.g., inertial oscillator).
  • .env.template – Template for environment variables.
  • pyproject.toml – Project dependencies and configurations.
  • uv.lock – Locked dependencies file for reproducibility.

Environment Setup

1. Clone the repository

git clone https://github.com/g-pa/piml-tutorial.git
cd piml-tutorial

2. Setup Python environment

This project uses Python with uv as the dependency manager. If you don’t have uv installed, you can install it following the official documentation.

Then you can install all the dependencies running the following command within the cloned repository:

uv sync

This command will:

  • Read the project's dependency specifications
  • Create a virtual environment (if one doesn't exist)
  • Install all required packages with their correct versions

3. Configure environment variables

  1. Copy the template .env.template to .env
  2. Modify .env accordingly to include all the custom paths needed

Running the tutorial

1. Activate the Python environment:

macOS and Linux

source .venv/bin/activate

Windows

.venv\Scripts\activate

2. Run the Jupyter notebooks

Run the notebooks in notebooks directory to explore Physics Informed Machine Learning examples.


References

About

Simple tutorial on Physics Informed Machine Learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors