April 2026
461 pages
17h 56m
English
As a first step, we recommend that you create a new notebook called Chapter 4. Then, create a Markdown cell with a heading, for example, “Perceptron learning algorithm”, and a code cell for the code to make it easier to read.
The core of the code is the fit function, in which learning takes place by means of weight adjustment, as shown in Listing 4.1. The iterations parameter determines how many steps are used to learn the training_data_set data.
# Plotimport matplotlib.pyplot as plt# Random number generatorfrom random import choice# For the mathematical operationsfrom numpy import array, dot, zeros, random# Very important, otherwise the plot will not be displayed%matplotlib inline# The Heaviside step function ...
Read now
Unlock full access