Загрузка данных


import numpy as np

import matplotlib.pyplot as plt axis np.linspace(-8.25, 1.25, 301)

P-[] for x2 in axis: row = [] for x1 in axis: h layer(x2), hidden w, hidden_b) row.append(neuron h, output w, output_b)[1])

P.append(row) fig, ax = plt.subplots(figsize=(6, 6)) ax.contourf(axis, axis, P, alpha=0.25) 0.5, 1],

ax.contour(axis, axis, P, [0.5]) ax.scatter([0, 1], [0, 1], label="XOR: 0") ax.scatter(0, 1], [1, 0], marker="s", label="XOR: 143

ax.set(xlabel="$x 15", ylabel="$x_25", aspect="equal")

ax.legend() plt.show()