Compute the L2 weight-decay penalty λ∑iwi2 of a weight vector (there is no factor 21).
Implement solve(w,lam).
Returns. Return a non-negative float.
Example 1
Input:
solve([1.0, 2.0, 3.0], 0.1)
Output:
1.4
Example 2
Input:
solve([0.0, 0.0], 5.0)
Output:
0.0
No results yet
Run your code to check it against the examples, or submit to run every test.