Hi @F_E
Put adding the regularization term outside both for loops before you divide J by 2. If you do it like that for each loop you add the full value of the regularization term. In other words, you are adding it multiple times and you have to add it only once at the end of the calculation of J.