Implement the L2 regularization penalty term.
Signature: def l2_reg(w: np.ndarray, lam: float) -> float
def l2_reg(w: np.ndarray, lam: float) -> float
Return lam * sum(w^2).
lam * sum(w^2)
Math
Asked at
Output
Anything you print() in your code will show up here after you click Run.
print()
Test Results