Skip to content

About

Code for the MSc AIM SE For Media Lectures and Labs

Resources

Stars

5 stars

Watchers

5 watching

Forks

Latest commit

 

History

213 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MSc AIM Software Engineering for Media

This code is used in the lectures for the SE for Media Unit for MSc AIM. The lecture pages, labs and seminars all live on the unit website and the code for them lives here.

It is expected you will use uv to run everything. Most of the notebooks are marimo notebooks, so from the root of the repo

uv sync
uv run marimo edit Lecture2/Lecture2Marimo.py

You can also open any of the marimo notebooks in the browser using molab, see Notebooks on molab for the links. Some may not work due to the requirement of Utils being needed but you can still read the text and understand what is happening. I will try to update the requirements as soon as possible.

The notebook glossary explains the terms used in the examples, with links to papers and other sources.

Note this README.md is autogenerate by claude on update and commit so may not be 100% accurate.

Contents

Lectures

The lecture numbers below follow the website, which doesn't always match the folder names (the LectureN folders stop at 7).

Lecture Slides Code Description
1 Slides Lecture1, IntroToMarimo Introduction to the unit, uv, and a first look at marimo
2 Slides Lecture2 Introduction to Python, numbers, strings, lists, tuples and dictionaries
3 Slides Lecture3 Sequence, selection and iteration, functions and exceptions
4 Slides Lecture4 Object oriented programming, accessors, aggregation, inheritance and operator overloading
5 Slides Lecture5, NumPyForML Using NumPy
6 Slides Lecture6, MatplotlibForML Matplotlib, Pandas and Polars
7 Slides Lecture7, PyTorchForML PyTorch and tensors
8 Slides LinearModel, Neuron, Checkpoints ML workflows with PyTorch
9 Slides Classification Simple, binary and multi-class classification
10 Slides MNIST, Packages Data loaders, the python path and the MNIST dataset

Machine learning notebooks

These build on the lectures and are the ones I use in the later machine learning sessions.

Folder Description
NumPyForML Five notebooks on the NumPy you actually need for the ML demos
MatplotlibForML Figures, plots, images and saving output
PlotlyForML Interactive plots with Plotly Express and Graph Objects, training curves and HTML export
PyTorchForML Tensors, autograd, modules, inference, data and saving models, plus a notebook on activation functions
TorchVisionForML Images, transforms, augmentation and datasets with torchvision
TorchAudioForML Waveforms, features, augmentation and audio datasets
TorchCodecForML Decoding video and audio into tensors with TorchCodec, clip sampling and datasets
Neuron A neural network from scratch in plain Python
LinearModel Fitting a linear model with PyTorch
Checkpoints Saving and restoring training checkpoints
Classification Simple, binary and multi-class classification
MNIST The MNIST dataset, data loaders, training, and a Qt sketch pad to test the model (Sketch)
ASL American Sign Language recognition in three parts (dense, CNN, data augmentation) with a real-time webcam demo in RealTimeCapture
FreeSpokenDigits The Free Spoken Digits audio dataset in three parts (data, data loaders, training) and a live microphone demo
PreTrainedModels Using pre-trained ImageNet models and transfer learning
DataToTensors Breaking down an ML problem, then looking at the shape and form of the data and getting it into tensors
DataLeakage Data leakage and why we need group splits
EvaluationOfResults Baselines and metrics for evaluating image results, and how to present them
ExperimentTracking TensorBoard and MLflow, as standalone scripts and within marimo
ImageToImage U-Net image-to-image learning for denoising, super resolution and pet segmentation
PointCloudsAndMeshNet Seven lessons on point clouds, from surface sampling to PointNet classification, segmentation and ModelNet10
TextProcessingRNN Text processing with recurrent neural networks (work in progress)
CloudTraining The ML DevOps cycle from prototype to container to inference endpoint, using podman to simulate the cloud

Labs and seminars

The lab and seminar write-ups are on the unit website, this is the code that goes with them.

Folder Description
Lab1 A small maths quiz program and images for the first lab
ImageLab Solution for Lab 4 An Image Class
Seminars/Arguments Starter and solution code for the Command Line Arguments seminar, using sys.argv, argparse and click
Seminars/Files Code for the File IO seminar, reading and writing text and CSV files

Support code

Folder Description
Utils Shared helpers used by the notebooks (downloading data, picking a device, accuracy, checking if we are in the lab)
IntroToMarimo An introduction to marimo notebooks and their UI elements
Packages How Python finds packages and why the notebooks use sys.path.append("../") to get at Utils
scripts A pre-commit hook I use to export the marimo notebooks to markdown

Notebooks on molab

Each of these links opens the notebook from GitHub in molab, the hosted version of marimo, so you can try things out without installing anything. Some of them won't work there as they need local hardware or tools (the microphone, webcam, Qt and podman demos for example), and the bigger training runs will be a lot slower than on a lab machine with a GPU.

Folder Notebooks
ASL ASLPart1Marimo, ASLPart2CNNMarimo, ASLPart3DataAugmentationMarimo
Checkpoints CheckPointsMarimo
Classification BinaryClassificationMarimo, MultiClassificationMarimo, SimpleClassificationMarimo
CloudTraining CloudTrainingMarimo
DataLeakage DataLeakageMarimo
DataToTensors DataToTensorsMarimo, DataToTensorsSolutionsMarimo, ProblemToModelMarimo
EvaluationOfResults BaselinesEvaluationMarimo
ExperimentTracking MLflowMarimo, TensorBoardMarimo
FreeSpokenDigits FSDDMarimoPt1, FSDDMarimoPt2, FSDDMarimoPt3, FSDDMicrophone
ImageToImage 01IntroductionMarimo, 02DenoisingMarimo, 03SuperResolutionMarimo, 04PetSegmentationMarimo
IntroToMarimo part1, part2_ui
Lecture2 Lecture2Marimo
Lecture3 Lecture3Marimo
Lecture5 IntroductionToNumpy
Lecture6 IntroductionToPandasMarimo, IntroductionToPolarsMarimo, MatplotlibMarimo
Lecture7 PyTorchAndTensorsMarimo
LinearModel LinearModelMarimo
MatplotlibForML MatplotlibForMLPart1Figures, MatplotlibForMLPart2Plots, MatplotlibForMLPart3Images, MatplotlibForMLPart4Output
MNIST PyTorchDataLoadersMarimo, ReadDigitsTrainingMarimo, TheMNISTDataSetMarimo
MNIST/Sketch SketchNumbersMarimo
Neuron nn_from_scratch, NNFromScratchSlides
NumPyForML NumPyForMLPart1Creation, NumPyForMLPart2Shapes, NumPyForMLPart3Maths, NumPyForMLPart4Random, NumPyForMLPart5Together
Packages PackagesMarimo
PlotlyForML PlotlyForML
PointCloudsAndMeshNet PointCloudForMLPart1Sampling, PointCloudForMLPart2Sets, PointCloudForMLPart3PointNet, PointCloudForMLPart4Classification, PointCloudForMLPart5Robustness, PointCloudForMLPart6Segmentation, PointCloudForMLPart7ModelNet
PreTrainedModels PreTrainedModelsPart1Marimo, TransferLearningMarimo
PyTorchForML PyTorchForMLActivations, PyTorchForMLPart1Tensors, PyTorchForMLPart2Autograd, PyTorchForMLPart3Modules, PyTorchForMLPart4Inference, PyTorchForMLPart5DataAndSaving
TextProcessingRNN RNNPart1
TorchAudioForML TorchAudioForMLPart1Waveforms, TorchAudioForMLPart2Features, TorchAudioForMLPart3Augmentation, TorchAudioForMLPart4Datasets
TorchCodecForML TorchCodecForMLPart1Video, TorchCodecForMLPart2Sampling, TorchCodecForMLPart3Audio, TorchCodecForMLPart4Datasets
TorchVisionForML TorchVisionForMLPart1Images, TorchVisionForMLPart2Transforms, TorchVisionForMLPart3Augmentation, TorchVisionForMLPart4Datasets

About

Code for the MSc AIM SE For Media Lectures and Labs

Resources

Stars

5 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages