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
Test Results