- Hands-On Neural Networks
- Leonardo De Marchi Laura Mitchell
- 240字
- 2025-04-04 14:15:16
Keras
Now that you have seen how to implement a perceptron from scratch in Python and have understood the concept, we can use a library to avoid re-implementing all of these algorithms. Luckily, there are plenty of libraries that make it possible for us to focus on the architecture and the composition of the network without having to lose time in too many implementation issues.
In particular, the main breakthrough of the last decade, and what has made the deep learning evolution so rapid, is the use of graphics cards. In particular, NVIDIA created CUDA, a programming interface that made it possible to use all of the power of modern Graphical Processing Unit (GPU) for general programming. A GPU is a piece of hardware primarily designed to render images; it contains a much higher number of cores compared to a CPU, but these cores are only capable of performing simple operations. They are ideal for matrix multiplication, and that's why they are able to speed up the computational time, even by 100, compared to a CPU.
TensorFlow is a library that uses CUDA to interact with the GPU, but it can also run on a normal CPU. Having a GPU is not necessary to run the examples in this book.
We will use Keras on top of TensorFlow, as it provides a high-level, Pythonic API that will allow us to quickly build even complex architectures.