Project 14 of 14, for Aaesha
Notebook Reader
The Act VII capstone, a deep learning project from start to finish: a small network learns Paul's notes four characters at a time, beats the bigram on notes it never saw, and finishes a note when you start one. It learns how he sounds, not what he means. With a write-up.
Sign up free to open itLog in
Act 7 needs a free account, so your work is saved as you go. Act 1 is open to everyone.
The brief
- AaeshaI've got every comment Paul's left on our code and the notes from his notebook margins, eighty-five of them, one a line.
- AaeshaI'd like a machine that reads them and finishes a note when you start one, in his voice.
- PaulAnd when it finishes one I never wrote?
- AaeshaThen we'll know how well it learnt you, or at least how you sound, if not what you mean.
The Notebook Reader, in four files, built in this order. Each starter is almost empty: a docstring listing what to write.
notes.py: load the 85 notes, hold every fifth back, build the vocabulary (with the newline), and cut the notes into windows: the ids of the characters before each character, padded with newlines, and its own id.baseline.py: perplexity, and the bigram, counted from the last character of each window. The scores to beat.model.py: a network that looks up the embeddings of four characters, lays them in a row, and guesses the fifth through a tanh layer and softmax. Forward, backward, and training on mini-batches. Run as a program, it trains and savesmy_weights.json.reader.py:complete(start, params, vocab, rng, temperature=1.0, limit=200)finishes a note, with the same note every time for the same seed. Run as a program, it reads with your weights if you've trained them, and Aaesha's if not.- A write-up and a test plan, through Paul's checklist.
Reading with Aaesha's weights. Good names one a you came test poen thing, the code that are in the code. P. The duck. P. Whoever reads this nrom the son. P.
What's in it
- Mark it out first
- A window of characters before
- The notes, as numbers
- The scores to beat
- Four characters in
- The network
- The notebook reader
- Milestone: the write-up
- Ship it