NN Prep thumbnail

NN Prep: Practice Exams for Neural Networks

The Neural Networks exam at RUG is a set of true/false statements where the false ones are a true statement with one detail quietly changed: a flipped quantifier, the wrong direction of an effect, a missing tanh. The only real way to prepare is to practice a lot of them, and there are only so many past questions. So I built NN Prep, a small app for practicing those statements, and a pipeline that writes new mock exams on demand.

What it does

You pick an exam (or all of them), optionally a chapter, and answer one statement at a time. You get the verdict and a short explanation right away. You can filter to questions you haven't seen or the ones you got wrong, and shuffle the order. The math is rendered with KaTeX. Chapters run from elementary probability through feedforward nets, RNNs and LSTMs, Hopfield networks and Boltzmann machines to reservoir computing.

You can use it as a guest, in which case progress stays in your browser. If you make an account, your progress lives on the server, follows you between phone and laptop, and puts you on a scoreboard.

Where the questions come from

Each exam is a folder with a questions.jsonl file: 22 statements, each with a chapter, an answer, an explanation and a reference into the lecture notes. A script called claude-create-new-exam generates them:

  1. It prompts Claude Code with the exam format, a fact list extracted from the lecture notes, the exercise sheets and the questions of the existing exams, with instructions not to repeat any of them.
  2. Claude writes the file, and a validator checks it: exactly 22 questions, every chapter covered, a sensible mix of true and false, valid JSON and LaTeX escaping, no duplicates.
  3. If validation fails, the errors are fed back into the prompt and Claude tries again, up to five times.
  4. Once the file passes, it is moved into place and synced to the server.

The validator catches structural problems, but not wrong facts. That is why every question carries a lecture-notes reference, and why I still read through the exams myself.

How it runs

The server is a single Python file using only the standard library: http.server for HTTP and sqlite3 for storage. There are no dependencies to install. Passwords are salted and hashed with PBKDF2, logins are rate limited, and an optional invite code can restrict who may create an account. The frontend is one static HTML page with no build step.

Exams are read from disk on every request, so a new exam appears the moment its folder lands on the server, without a restart. Users and progress live in a Docker volume, and the exams are mounted into the container read-only.

On the VPS it is one Docker container bound to localhost, behind an nginx reverse proxy on its own subdomain. Deploying is a ./deploy.sh that rsyncs the code and rebuilds the container, or ./deploy.sh exams to push only new exams.

Try it

nnprep.sigurdurhaukur.com: continue as a guest and start with the exam of your choice.

#tools #web #machine-learning