+ errors[linear_layer].append((nb_hidden, test_error))
+
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+fig.set_figheight(6)
+fig.set_figwidth(8)
+
+ax = fig.add_subplot(1, 1, 1)
+
+ax.set_ylim(0, 1)
+ax.spines.right.set_visible(False)
+ax.spines.top.set_visible(False)
+ax.set_xscale("log")
+ax.set_xlabel("Nb hidden units")
+ax.set_ylabel("Test error (%)")
+
+X = torch.tensor([x[0] for x in errors[nn.Linear]])
+Y = torch.tensor([x[1] for x in errors[nn.Linear]])
+ax.plot(X, Y, color="gray", label="nn.Linear")
+
+X = torch.tensor([x[0] for x in errors[QLinear]])
+Y = torch.tensor([x[1] for x in errors[QLinear]])
+ax.plot(X, Y, color="red", label="QLinear")
+
+ax.legend(frameon=False, loc=1)
+
+filename = f"bit_mlp.pdf"
+print(f"saving {filename}")
+fig.savefig(filename, bbox_inches="tight")