Skip to content

Repository files navigation

Tensors for Machine Learning

Publish Site Built with Quarto Open in Colab Slides EN Diapositivas ES

A 3-hour workshop (195 minutes including three Kahoot knowledge checks) that takes you from "I know matrices" to manipulating, solving, convolving and factorizing tensors.

📍 project-delphi.github.io/tensors-workshop · 🇪🇸 En español


Who it is for

You have read Deep Learning (Goodfellow, Bengio & Courville), Chapter 2 — Linear Algebra. You know matrices. The workshop assumes no previous knowledge of tensor theory, and every new term is defined where it first appears.

Taught in English; questions welcome in Spanish or English. The slide deck exists in both languages and every notebook heading carries a one-line Spanish summary.

Prerequisites

  • The linear algebra in Chapter 2: vectors, matrices, the matrix product, the inverse, eigendecomposition, SVD.
  • A Google account, to run the notebooks in Colab. Nothing to install.
  • Three CSV files download at the start. Run notebook 00 before the session — a silent download failure leaves you stuck at sections 07 and 10, an hour in.
  • Required pre-work: work through linear-algebra-deep-learning before the session — 14 short bilingual Colab notebooks (~2–3 hours total) covering exactly the linear algebra above, vectors through PCA. This workshop moves fast through material that assumes you've done this review.

All the data is real

No synthetic random arrays anywhere. Real tumour measurements, real handwritten digits, real histology and microscopy images, real New York taxi trips, real airline traffic — because real data contains problems random data never shows: missing values, features on incompatible scales, pixels that never change. Finding those problems is part of the work.

Most of it ships inside scikit-learn and scikit-image (load_breast_cancer, load_digits, data.camera(), data.astronaut()). California Housing, NYC Taxi Trips and the Airline Passengers series are downloaded once.

The sections

# Section Slides EN Slides ES Notebook Quiz
00 Setup and welcome EN ES Colab
01 What a tensor is EN ES Colab Q1
02 Thinking in N dimensions EN ES Colab
03 Indexing and broadcasting real data EN ES Colab Q1
04 Reshape and transpose real images EN ES Colab Q1
05 Video pipeline design EN ES Colab
06 Contraction with einsum EN ES Colab Q2
07 Inverses and the pseudoinverse EN ES Colab Q2
08 Recursion with matrices and vectors EN ES Colab
09 Convolution and deconvolution EN ES Colab Q3
10 Tucker decomposition on real data EN ES Colab Q3
11 Wrap-up and take-homes EN ES Colab

The 🎯 quizzes run after sections 04, 07 and 10. The twelve sections come to 165 minutes; the three quizzes add 15 and three 5-minute breaks another 15, for 195.

Run it locally

git clone https://github.com/project-delphi/tensors-workshop.git
cd tensors-workshop
quarto preview          # live-reloading site at http://localhost:4200
quarto render           # writes docs/

Only Quarto is needed to build the site — the notebooks are not executed at render time. To run the notebooks locally instead of in Colab:

uv run --with numpy,pandas,scikit-learn,scikit-image,scipy,jupyterlab jupyter lab

Regenerating the derived files

_variables.yml is the single source of truth: repo coordinates, the twelve sections, the three quizzes. Two scripts read it, and nothing they produce should be edited by hand:

uv run --with pyyaml python scripts/gen_tables.py               # tables + README tables
uv run --with pyyaml,nbformat python scripts/gen_notebooks.py   # the 12 notebooks
uv run --with pyyaml,nbformat python scripts/check_links.py     # verify docs/

How it deploys

GitHub Pages serves the docs/ folder on main, so docs/ is committed. .github/workflows/publish.yml re-renders on every push and fails if the committed docs/ is stale or any link is broken — it is a guard, not the publisher. Render and commit docs/ along with your change.

Repo layout

_variables.yml          single source of truth — sections, quizzes, URLs
_quarto.yml             website config; renders to docs/
_includes/              generated tables, included by the .qmd pages
index.qmd  es/index.qmd landing pages, EN and ES
notebooks.qmd  kahoot.qmd
slides/en/  slides/es/  the two revealjs decks + shared slides.scss
notebooks/              12 Colab notebooks, one per section
kahoot/                 3 .xlsx quiz import files
scripts/                generators and the link checker
tensors_workshop_plan_with_quizzes.md   the source handbook
docs/                   rendered site (committed — this is what Pages serves)

Directory READMEs: notebooks/ · slides/ · kahoot/

Further reading

Books, the seminal Tucker/CP/SVD papers (with DOIs and author pages), and the tensorly docs: see Further Reading in the Handbook.


Tensores para Aprendizaje Automático

Un taller de 3 horas (195 minutos con tres controles de conocimiento con Kahoot) que te lleva de «sé lo que es una matriz» a manipular, resolver, convolucionar y factorizar tensores.

📍 project-delphi.github.io/tensors-workshop/es · 🇬🇧 In English

Para quién es

Has leído Deep Learning (Goodfellow, Bengio y Courville), capítulo 2 — Álgebra lineal. Sabes qué es una matriz. El taller no supone ningún conocimiento previo de teoría de tensores, y cada término nuevo se define donde aparece por primera vez.

Se imparte en inglés; las preguntas son bienvenidas en español o en inglés. Las diapositivas están en los dos idiomas y cada encabezado de los cuadernos lleva un resumen de una línea en español.

Requisitos previos

  • El álgebra lineal del capítulo 2: vectores, matrices, el producto matricial, la inversa, la descomposición espectral y la SVD.
  • Una cuenta de Google para ejecutar los cuadernos en Colab. No hay que instalar nada.
  • Al principio se descargan tres archivos CSV. Ejecuta el cuaderno 00 antes de la sesión: una descarga que falla en silencio te deja atascado en las secciones 07 y 10, una hora después.
  • Trabajo previo obligatorio: completa linear-algebra-deep-learning antes de la sesión — 14 cuadernos breves de Colab, bilingües (~2–3 horas en total), que cubren exactamente el álgebra lineal anterior, de vectores a PCA. Este taller avanza rápido y da por hecho que ya lo hiciste.

Todos los datos son reales

Ni un solo array aleatorio. Medidas reales de tumores, dígitos manuscritos reales, imágenes reales de histología y microscopía, viajes reales en taxi de Nueva York, tráfico aéreo real, porque los datos reales contienen problemas que los aleatorios nunca muestran: valores faltantes, variables en escalas incompatibles, píxeles que nunca cambian. Encontrar esos problemas es parte del trabajo.

Las secciones

# Sección Diapos EN Diapos ES Cuaderno Quiz
00 Preparación y bienvenida EN ES Colab
01 Qué es un tensor EN ES Colab Q1
02 Pensar en N dimensiones EN ES Colab
03 Indexación y broadcasting con datos reales EN ES Colab Q1
04 Reshape y transposición de imágenes reales EN ES Colab Q1
05 Diseño de un pipeline de vídeo EN ES Colab
06 Contracción con einsum EN ES Colab Q2
07 Inversas y la pseudoinversa EN ES Colab Q2
08 Recursión con matrices y vectores EN ES Colab
09 Convolución y deconvolución EN ES Colab Q3
10 Descomposición de Tucker con datos reales EN ES Colab Q3
11 Cierre y ejercicios para casa EN ES Colab

Los cuestionarios 🎯 se ejecutan después de las secciones 04, 07 y 10. Las doce secciones suman 165 minutos; los tres cuestionarios añaden 15 y las tres pausas de 5 minutos otros 15: en total, 195.

Ejecutarlo en local

git clone https://github.com/project-delphi/tensors-workshop.git
cd tensors-workshop
quarto preview          # sitio con recarga automática en http://localhost:4200
quarto render           # escribe docs/

Solo hace falta Quarto para construir el sitio: los cuadernos no se ejecutan al renderizar.

Cómo se publica

GitHub Pages sirve la carpeta docs/ de main, así que docs/ está en el repositorio. .github/workflows/publish.yml vuelve a renderizar en cada push y falla si el docs/ publicado está desactualizado o si algún enlace está roto. Renderiza y haz commit de docs/ junto con tu cambio.

Lectura adicional

Libros, los artículos originales de Tucker/CP/SVD (con DOI y páginas de los autores) y la documentación de tensorly: consulta Further Reading en el Handbook (en inglés).

About

Tensors for Machine Learning — 3-hour workshop handbook and Kahoot quizzes

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages