November 2018
Intermediate to advanced
310 pages
7h 54m
English
We will now add two methods for inference to our SequentialNetwork class—that is, for predicting an output given for a particular input. The first method we will just call predict, which will be used by the end user. In the course of the training process, we will have to make predictions based on a partial result from only some of the layers, and we will make another method to this end called partial_predict.
Let's start by implementing predict. This will take two inputs—a collection of samples in the form of a one- or two-dimensional NumPy array, and possibly a user-defined CUDA stream. We will start by doing some type-checks and formatting on the samples (here, called x), remembering that the samples ...
Read now
Unlock full access