====== Lab 03 ====== ===== Factor Graphs ===== During this lab, you should get a bit deeper understanding of the factorgraph concepts presented during the lectures. {{ :courses:aro:tutorials:labs_03_templates.zip |}} \\ {{ :courses:aro:tutorials:labs_03_program.pdf |}} ===== Pytorch installation ===== You will need Pytorch and matplotlib installed on your PC for this (and only this) lab (either inside or outside the ARO Apptainer). If you have any working Pytorch and matplotlib installation on your PC, then you're ready for the lab. If you don't, follow this tutorial (for Ubuntu Linux): Please, make sure to be outside any Conda environments when following this tutorial. ====== Outside ARO Apptainer ====== sudo apt update && sudo apt install python3-venv python3 -m venv --system-site-packages ~/pytorch_venv # or any other folder in your home source ~/pytorch_venv/bin/activate pip install torch matplotlib # This downloads about 900 MB of data and takes 7 GB on disk ====== Inside ARO Apptainer ====== python3 -m virtualenv --system-site-packages ~/pytorch_venv # or any other folder in your home source ~/pytorch_venv/bin/activate pip install torch # This downloads about 900 MB of data and takes 7 GB on disk If you won't need PyTorch for anything else and you don't need GPU support (this lab does not need it), you can install the CPU-only version of PyTorch. It only takes up 1 GB on disk. # pip install torch matplotlib # instead of this, do the following two commands pip install matplotlib pip install torch --index-url https://download.pytorch.org/whl/cpu ====== Using the virtualenv ====== When you leave this console or reboot your computer, you get the virtualenv back by calling ''source ~/pytorch_venv/bin/activate''. If you're on WSL, the installation of Pytorch took too much space and deleting the virtualenv doesn't free up the space, please follow [[https://superuser.com/a/1612289|this guide]] to reclaim the taken space.