Skip to content

An official repository for tutorials of Probabilistic Modelling and Reasoning (2023/2024) - a University of Edinburgh master's course.

Notifications You must be signed in to change notification settings

vsimkus/pmr2024-hmm

Repository files navigation

PMR computer tutorials on HMMs (2023-2024)

This is a repository for computer tutorials of Probabilistic Modelling and Reasoning (2023/2024) - a University of Edinburgh master's course.

The tutorial consists of three parts:

  1. HMM basics
  2. HMM inference, this tutorial contains a few questions for you to think about.
    • A notebook with the solutions is also provided here
  3. HMM learning (with coding exercises), this tutorial contains a few code snippets for you to fill in
    • A notebook with complete code is also provided here

Environment setup

Before you start with the tutorials you will first need to setup the environment on your preferred machine. The tutorials will use simple examples, hence any machine will do.

Setup on your machine

You'll need to open terminal on your machine and then follow the below instructions

  • Install git (linux, macOS, windows) to access the repository if you don't have it already
  • Clone the git repository on your machine by running git clone in the terminal (you can find a guide here)
  • Once you've cloned the repository, step into the directory by entering cd pmr2024-hmm into the terminal
  • If you don’t already have it also install miniconda (linux, macOS, windows), which will allow you to manage all python dependencies per project
  • You can now create the pmr conda environment by typing conda env create -f environment.yml. This step may take a while to complete since it has to download large binaries and you should better be connected to a good internet connection.

Starting the Jupyter server

Once you have the environment prepared you can start your jupyter notebook

  • Activate the conda environment with conda activate pmr
  • Now you will be able to start your jupyter server by typing jupyter notebook, which will start the server and open a browser to access the tutorial notebook. Click tutorial link in the browser window. You can stop the server by pressing Ctrl+c (or Cmd+c) in the terminal when you are done with it.

Google Colab

You can also access and run the notebooks on Google Colab directly via this link http://colab.research.google.com/github/vsimkus/pmr2024-hmm. More details can be found at https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb#scrollTo=WzIRIt9d2huC.

Note that the Colab notebook environment should already include all the required dependencies, however, the versions may differ, hence the results may differ slightly from the provided solutions but that should not be a problem for this tutorial.

Attributions

The tutorials in this repository were authored by Yao Fu and Shangmin Guo in discussion with Michael Gutmann, and edited by Vaidotas Šimkus and Chris Williams.

About

An official repository for tutorials of Probabilistic Modelling and Reasoning (2023/2024) - a University of Edinburgh master's course.

Topics

Resources

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •