Code-along exercises and interactive tools for the lectures · Tobias Blanke, University of Amsterdam
Open the page for this week's lecture and code along with us. The lecture notebooks open in Colab; each week's workshop has a page with the instructions and a link that opens its notebook. In Colab, always start with File → Save a copy in Drive. The interactive tools are the demonstrations from the slides: try them again at home.
Getting set up: Colab, Google Drive, the terminal, file paths, and checking an AI agent
Code along: three parts, each with exercises in Python Tutor (calculator, variables, types, lists, dictionaries, if … else, loops, functions) and then the matching section of the lecture notebook
Lecture notebook in Colab: the notebook environment, data types, lists and arrays, event-driven and sequential programs (save a copy first)
Computer Programming Spectrum, with the agentic programming overlay
Workshop: Python: the notebook environment, lists and arrays, sequential and event-driven programs, a first real-life dataset
Tools: CPU simulator · Loops in four languages
Code along: machine learning: linear regression, the k-means walkthrough by hand, the teens data
Lecture notebook in Colab: how a machine learns from data, and who decided: a neural network predicts danceability, k-means finds groups among teenagers (save a copy first)
Workshop: data critique and machine learning: the data critique of a donations dataset in groups, then k-means for the US Senate and decision trees for danceability
Tools: Term frequency · How a computer sees an image · Neural network training
Code along: text: bag of words, TF-IDF, list comprehension, 230 years of State of the Union speeches, language models
Lecture notebook in Colab: how a computer reads a text, step by step: tokens, cleaning, counting and tf-idf, named entities, a hate-word dictionary, topic models and word vectors, with State of the Union speeches (save a copy first)
Workshop: text and language models: transformers with Hugging Face, and a group exercise on language models through their APIs (two notebooks to choose from)
Tools: Term frequency · From words to embeddings
A small von Neumann computer. Step through fetch, decode and execute, and watch a loop run in machine code.
The same for loop in Assembly, Python, JavaScript and C++, side by side and stepping together: 24 machine instructions against 11 steps.
Turn three documents of your own into a bag of words, weight it with TF-IDF, and see which documents come out alike.
A photo at 8, 16 or 32 pixels square, as three colour planes of numbers and as one row of features. Upload your own picture too.
A network of 12 neurons learns cats from dogs by backpropagation. See which weights change most, and test it on animals it has never seen.
Illustrative dataTerm frequency against real sentence embeddings, and a multimodal space you can train, where words find their nearest pictures.
A history of AI ethics: the interactive map from the AI ethics lecture, kept in its own repository.