Hands On: Time Travel Testing
You might be itching to see the neural network running, even though it’s incomplete. Right now we have the classification code, that needs pre-calculated weights—but not the training code, that finds the values of those weights. How can we check the first without the second?
We can solve this problem thanks to time travel. Book authors have mastered that elusive skill—and guess what: I just returned from the future, where I have access to the complete neural network code. After training the complete network for a few iterations, I serialized the two matrices of weights to a JSON file named weights.json, that you can find among this chapter’s source code.
Go forth, give it a try. Paste this code at the end of forward_propagation.py ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access