in code/figure_1/penalties.py [0:0]
def penalty_g(x1, y1, x2, y2, t=1):
phi = np.diag([1, t])
w = np.array([1, 0]).reshape(2, 1)
p1 = (phi.T @ x1.T @ x1 @ phi @ w - phi.T @ x1.T @ y1) / x1.shape[0]
p2 = (phi.T @ x2.T @ x2 @ phi @ w - phi.T @ x2.T @ y2) / x2.shape[0]
return np.linalg.norm(p1) ** 2 + np.linalg.norm(p2) ** 2