Chapter 6 — Reimplement TinySleepNet
Think of it like this: an assembly line with two stations. Station 1 is Workshop 1's stamp ("Robo Learns to Spot a Spindle") — every single epoch rolls through alone, gets scanned, and comes out the other end as a small summary card. Station 2 is Workshop 2's journal ("Robo Remembers") — it takes the whole stack of summary cards, in order, and reads through them one at a time, updating its memory as it goes, making a decision for each card using both that card AND everything it remembers from the cards before it. TinySleepNet is exactly this assembly line, trained as one single model instead of two separate pieces.
If you haven't played both workshops yet, this chapter will make a lot more sense after you have — everything below is just naming, in words, what you already watched happen.
Why "Tiny"
The full-size original (DeepSleepNet, covered next chapter) uses two separate CNN branches and a two-step training process. TinySleepNet strips that down to one CNN branch and a single LSTM layer — lighter, faster to train, and realistic to run on a laptop or a single GPU. That's precisely why this course builds toward TinySleepNet first: it's the version you can actually finish training yourself, today, in this lab.
A REAL ONE IS ALREADY SITTING IN DREAMENTO
Here's something worth knowing before you write a line of code: Dreamento's own repository already contains a full TinySleepNet implementation — a real TinySleepNet class, right in model.py and nn.py. It's written in old TensorFlow 1.x (tf.contrib, an API that no longer exists in modern TensorFlow), sitting alongside the actively-used DreamentoScorer (which, as Chapter 4 mentioned, is LightGBM, not a neural network at all). Chapter 8 goes through that code directly. For now, just know: you're about to build a smaller cousin of something that already exists, in this exact project, waiting to be modernized.
What's Different From a Faithful Reproduction
This lab's version is deliberately simplified, and the lesson is honest about every simplification rather than hiding them: shorter sequences (10 epochs instead of the paper's ~20–25), far fewer training rounds, one subject to train on instead of a large pooled dataset, and a single training stage instead of the paper's original two-stage process. None of that makes the lab fake — it makes it finishable in one sitting, which is the actual goal right now. A faithful, publication-quality reproduction is a real project for later, not a first lab.
THE LAB
Train a real CNN+LSTM on raw EEG — not hand-computed features, the actual signal — using the exact same Alice/Bob subject split as Chapter 4. Then compare your confusion matrix directly against the Random Forest baseline on the identical test set.
DONE WHEN
You have a trained model and a clear comparison table against Chapter 4: overall accuracy, per-stage performance, and specifically whether N1/REM confusion improved. Don't expect a huge jump over the baseline yet — 15 training rounds on one subject is a demonstration, not a competition entry. The point is watching both workshops' ideas work together on real data for the first time.
Chapter 7 reads the architecture TinySleepNet simplifies — DeepSleepNet — critically, alongside one more design choice from the field. Chapter 8 opens Dreamento's actual code and maps out exactly where a trained model like the one you just built would plug in.