Runnable notebooks on AI by José Manuel Ramírez Sánchez.
Every notebook runs on a laptop CPU in minutes, uses only public or synthetic data (no personal or clinical data), and is written so the same mechanism can be reused on a real project by swapping only the data-loading section.
| Notebook | What it teaches | English | Español |
|---|---|---|---|
| MFCC and PLP from scratch | The classic acoustic features rebuilt in NumPy (MFCC, PLP, RASTA-PLP), checked against librosa and spafe, a small noise experiment, and the bridge to Whisper's log-Mel input | en · Colab | es · Colab |
| Fine-tuning Whisper with Optuna, cross-validation and MLflow | Fine-tuning on real speech (LibriSpeech subset): chapter-grouped CV, Optuna pruning, nested MLflow runs, a locked test set and a zero-shot baseline | en · Colab | es · Colab |
| PEFT and LoRA on Whisper | Where to place LoRA adapters for a downstream classifier vs. an embedding extractor; adapter checkpoints (synthetic audio) | en · Colab | es · Colab |
| Radial LoRA (R-LoRA) on Whisper | R-LoRA implemented from scratch in PyTorch as a drop-in wrapper for any nn.Linear: numerical checks, a classifier next to a LoRA baseline, matching the learning rate to the radial operator, the learned λ, why it cannot be merged, saving and reloading, and an embedding extractor (synthetic audio) |
en · Colab | es · Colab |
| Inside an LLM guard | Reading a guard's verdict token as a continuous score, a logit lens with a probability-mass rule, the indirect-prompt-injection blind spot, and verdict-first vs rationale-first JSON for a prompted generalist guard (Qwen3Guard-Gen-0.6B, Qwen3-0.6B; 20 synthetic cases) | en · Colab | es · Colab |
| The 10% of the terminal: a lab with four flags | The four terminal skills of the post (moving around, SSH with keys and an alias, tmux, top) practised on a real SSH server inside Google Colab, with a hidden flag per section and a check() cell |
en · Colab | es · Colab |
Written walkthroughs: https://jmramirez.engineer/tutorials/
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
jupyter labOn Colab, open a notebook with the badge above; the first cell lists the %pip install line it needs.
The terminal lab is the exception: it runs only in Google Colab. It installs packages, creates a user with a known password and starts an SSH server inside Colab's disposable virtual machine, so do not run it on your own computer or on a shared server.
The MFCC/PLP and Optuna notebooks download hf-internal-testing/librispeech_asr_dummy, a 73-utterance subset of LibriSpeech (Panayotov et al., 2015, CC BY 4.0). The PEFT and R-LoRA notebooks generate synthetic tones in memory. The LLM-guard notebook defines 20 fictional text cases in the notebook itself. The terminal lab generates its files and flags when you run it.
Code in these notebooks is released under the MIT License. Text is © José Manuel Ramírez Sánchez, CC BY 4.0 (see LICENSE and LICENSE-TEXT.md).