The first term looks a normal cross-entropy loss function.
The second term is a regularization term. It increases the cost function to "punish" large values for weights. It's called L2 weight-decay (L2 means it's using the square value, L1 means absolute value). This is done to prevent overfitting, because it makes it more difficult for the network to learn noise from input samples.
Now for the formula: (note that the formula is for a whole batch of
m input samples).
The summation symbol is just another way of writing a for-loop so what the three summations means is this: for each layer
l and for every pair of connecting units
j, take the square of the weight from
i, then add everything.
The lambda parameter is just used to control how much regularization you want; a large lambda means you want you want your network to be very regularized, a small lambda means you just want a little bit of regularization.