https://github.com/vsimkus/pmr2024-hmm
An official repository for tutorials of Probabilistic Modelling and Reasoning (2023/2024) - a University of Edinburgh master's course.
https://github.com/vsimkus/pmr2024-hmm
hidden-markov-models hmm hmm-model hmm-viterbi-algorithm nlp probabilistic-inference probabilistic-models
Last synced: 5 months ago
JSON representation
An official repository for tutorials of Probabilistic Modelling and Reasoning (2023/2024) - a University of Edinburgh master's course.
- Host: GitHub
- URL: https://github.com/vsimkus/pmr2024-hmm
- Owner: vsimkus
- Created: 2022-02-13T12:42:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-02T10:12:38.000Z (almost 2 years ago)
- Last Synced: 2025-04-02T08:13:00.711Z (7 months ago)
- Topics: hidden-markov-models, hmm, hmm-model, hmm-viterbi-algorithm, nlp, probabilistic-inference, probabilistic-models
- Language: Jupyter Notebook
- Homepage: https://opencourse.inf.ed.ac.uk/pmr/
- Size: 253 KB
- Stars: 23
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PMR computer tutorials on HMMs (2023-2024)
This is a repository for computer tutorials of [Probabilistic Modelling and Reasoning (2023/2024)](https://opencourse.inf.ed.ac.uk/pmr/) - a University of Edinburgh master's course.
The tutorial consists of three parts:
1. [HMM basics](<./HMM basics.ipynb>)
2. [HMM inference](<./HMM inference with questions.ipynb>), this tutorial contains a few questions for you to think about.
* A notebook with the solutions is also provided [here](<./HMM inference complete.ipynb>)
3. [HMM learning (with coding exercises)](<./HMM learning with code exercises.ipynb>), this tutorial contains a few code snippets for you to fill in
* A notebook with complete code is also provided [here](<./HMM learning complete.ipynb>)## 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](https://git-scm.com/download/linux), [macOS](https://git-scm.com/download/mac), [windows](https://git-scm.com/download/win)) 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](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository))
* 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](https://conda.io/projects/conda/en/latest/user-guide/install/linux.html), [macOS](https://conda.io/projects/conda/en/latest/user-guide/install/macos.html), [windows](https://conda.io/projects/conda/en/latest/user-guide/install/windows.html)), 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 . More details can be found at .
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](https://github.com/FranxYao/) and [Shangmin Guo](https://github.com/Shawn-Guo-CN) in discussion with [Michael Gutmann](https://michaelgutmann.github.io/), and edited by [Vaidotas Šimkus](https://github.com/vsimkus) and [Chris Williams](https://homepages.inf.ed.ac.uk/ckiw/).