fig, ax = plt.subplots(figsize=(10, 4))
top = 100
fontsize = 13
xc = 10; yc = top / 2
ax.text(xc, yc, "Incoming weighted values\nfrom prior layer", fontsize=fontsize,
va="center", ha="center", rotation=90)
xc = 70; yc = top / 2
circle = Circle((xc, yc), 20, color="lightgrey", ec="black", lw=2)
ax.add_artist(circle)
xl = 25; xr = 45
y1 = 0.8; y2 = 0.5; y3 = 0.2
f = (xr - xl) / (xc - xl)
for y in [y1, y2, y3]:
ax.annotate("", xytext=(xl, y * top),
xy=(xr, top * (f * (y - 0.5) + 0.5)),
arrowprops={"arrowstyle": "->"})
ax.text(xc, yc + 2, "values\nsummed,\nbias added", fontsize=fontsize,
va="center", ha="center")
xl = xc + (xc - xr); xr = xl + 20
ax.annotate("", xytext=(xl, yc), xy=(xr, yc),
arrowprops={"arrowstyle": "->"})
ax.text(xr + 20, yc, "Activation\nfunction", fontsize=fontsize,
va="center", ha="center")
xl = xr + 40; xr = xl + 20
ax.annotate("", xytext=(xl, yc), xy=(xr, yc),
arrowprops={"arrowstyle": "->"})
ax.text(xr + 15, yc, "weight", fontsize=fontsize,
va="center", ha="center")
xl = xr + 30; xr = xl + 20
ax.annotate("", xytext=(xl, yc), xy=(xr, yc),
arrowprops={"arrowstyle": "->"})
xc = xr + 15
circle = Circle((xc, yc), 12, color="lightgrey", ec="black", lw=2)
ax.add_artist(circle)
ax.text(xc, yc, "next\nnode", fontsize=fontsize,
va="center", ha="center")
ax.set_xlim(0, 2.6 * top)
ax.set_ylim(0, top)
ax.set_axis_off()
plt.tight_layout()
plt.show()