Skip to Main Content
Programming Machine Learning
book

Programming Machine Learning

by Paolo Perrotta
March 2020
Beginner to intermediate content levelBeginner to intermediate
342 pages
8h 38m
English
Pragmatic Bookshelf
Content preview from Programming Machine Learning

Coding Forward Propagation

Here is a reprint of forward, a core function of our perceptron:

 def​ ​forward​(X, w):
  weighted_sum = np.matmul(X, w)
 return​ sigmoid(weighted_sum)

forward implements the operation that we called “forward propagation”: it calculates the system’s outputs from the system’s inputs. In the case of the perceptron, it applies a weighted sum followed by a sigmoid. In the case of a neural network, things become slightly more complicated.

In fact, this is where the name “forward propagation” really comes into its own: passing an MNIST image through a neural network is like propagating data “forward” through the network’s layers, from input to hidden to output.

The first step of forward propagation is the same as a regular ...

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.
Start your free trial

You might also like

Mastering Machine Learning Algorithms - Second Edition

Mastering Machine Learning Algorithms - Second Edition

Giuseppe Bonaccorso
Practical Machine Learning for Computer Vision

Practical Machine Learning for Computer Vision

Valliappa Lakshmanan, Martin Görner, Ryan Gillard

Publisher Resources

ISBN: 9781680507706Errata Page