Programming Neural Networks with Python
by Rheinwerk Publishing, Inc, Dr. Joachim Steinwendner, Dr. Roland Schwaiger
5.5 The Setup ("class")
We’ll now implement this blueprint in Python using object orientation. The ANN is supposed to be implemented as a Python class, and because it’s a multilayer neural network, we’ll call the class MLP. We keep the overhead very low and define the MLP class as a shell for the most important methods: __init__ and predict. As a goodie, we also implement the print method, which prints out the network architecture, as you’ve already seen in Figure 5.11. We’re going to explain the implementation in chunks as we don’t want to overwhelm you with the complete code.
For this purpose, you need to create a new notebook called Chapter 5 in Jupyter and use the tried-and-tested combination of Markdown and code cell again. Enter “Multilayer ...
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