Calculation of Regularization Parameter in a Cost Function

In Cost Functions for Regularized linear regression and logistic regression models, is Regularization Parameter nested inside the summation or is it added separately?

Which means that when we run the Cost Function, the loss function is calculated “m” times. For every iteration of “m”, will the Regularization Parameter calculated? This would mean that the Regularization Parameter is calculated n x m times.

There are two separate summations.
The first one is over all of the examples.
The second one is over all of the features.

Please correct me here. This means that the first summation will be executed “m” times and the second summation will be calculated “n” times, not “m x n” times, right?

Yes!

Cheers,
Raymond