markers = ['^', 'v', '>', '<']
colors = ['r', 'g', 'b', 'gray']
plt.figure(figsize=(8, 6))
plot_model(w1, w2, b)
for k, idx in enumerate([17, 21, 43, 66]):
x = torch.Tensor(X1[idx])
ret = perceptron(x)
act = activation(ret)
act_limiar = 0 if ret.data < 0 else 1
label = 'ret: {:5.2f}'.format(ret.data.numpy()[0]) + ' limiar: {:4.2f}'.format(act_limiar) + ' act: {:5.2f}'.format(act.data.numpy()[0])
plt.plot(x[0], x[1], marker=markers[k], color=colors[k], markersize=10, label=label)
plt.legend()
plt.show()
Caso o ponto estivesse no meio da linha o 'perceptron(x)' retornaria 0?