Skip to content

psteinb/2024-intro2ml-cern-school-of-computing

Repository files navigation

Jupyter Notebooks for the 2024 CERN School of Computing Course on Machine Learning

https://indico.cern.ch/event/1376644/

installation instructions for local execution

Some dependencies are rather hard to install for this workflow. The requirements.txt was tested with python 3.9 to 3.12.

  1. clone this repo: git clone https://github.com/psteinb/2024-intro2ml-cern-school-of-computing csc24-ml
  2. change into the repo root folder: cd csc24-ml
  3. create a venv by python -m venv py311 --upgrade-deps (e.g. for python 3.11)
  4. setup that venv by doing source py311/bin/activate
  5. (optional) install uv for faster installations (see uv docs)
  6. either do uv pip install -r ./requirements.txt or plain python -m pip install -r ./requirements.txt

If you like to train cpu-only, you can install torch without CUDA support. This is best beformed between step 2 and 4 in the recipe above by running:

uv pip install --extra-index-url https://download.pytorch.org/whl/cpu torch

or without uv:

python -m pip install --extra-index-url https://download.pytorch.org/whl/cpu torch

Usage on SWAN

If you want to use the CERN SWAN system, here is a brief intro on how to do it:

  1. open https://swan.cern.ch (provide your credentials if required)

  2. you should be queried for the software environment to setup (if not use ... in the top menue and click Change configuration)

default SWAN software environment
Make the changes as highlighted below:
edited SWAN software environment
  1. Under My Projects, click on Download Project from git (right hand side)
SWAN projects landing page
You should see this now:
SWAN git project URL
  1. insert the URL to this repo https://github.com/psteinb/2024-intro2ml-cern-school-of-computing.git (including a trailing .git suffix as indicated)
SWAN git project filled correctly
  1. Hit Download!

  2. You should see something like this

SWAN git project correctly downloaded
  1. Please open notebooks/00_intro2ml_envcheck.ipynb. Read and run all cells!

Updating your project

If this repo changes, you may want to update your version of this repository on SWAN. To do this, you have to follow these 2 steps:

  1. Open a terminal in the SWAN webgui
SWAN terminal
  1. Navigate to your project space. According to the steps outlined earlier, this should be:
cd SWAN_projects/2024-intro2ml-cern-school-of-computing/

Note: if you altered the notebooks during the exercises, the following command might fail. Please git-stash your changes or move them out of the way by renaming and git-restoring them.

  1. perform a git pull
git pull

This might look as much as:

SWAN terminal

Check your Software Stack

This repo has a small utility prepared which can check if you software environment is ready. Either run:

python notebooks/00_intro2ml_envcheck.py

If you are running on SWAN and you receive the error relative to the missing package mnist1d, please run:

python -m pip install --user mnist1d

or open the paired notebook notebooks/00_intro2ml_envcheck.ipynb, read the instructions and execute all cells.

Teaching this material

If you are an instructor, please see the instructor notes.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •