Softmax regression cost function code
It's a loss function applied to a regression with l2 penalty on the parameters.
The first square brackets can be interpreted in the following way:

$ - \frac{1}{n} $ has the minus because it wants to minimize.
$\sum_{i=1}^{n}$ means for each data point.
$\sum_{j=0}^{k-1} $ means for each class.
$y_i == j$ means that the fraction after this term is calculated only for true class. This check makes sense because y true is an OHE vector like [0, 0, 1], therefore you want to evaluate only the predicted probability associated with the true class. Take into account softmax function: if you increase the probability of a single output in output in the softmax you are implicitly reducing the probabilities of the other outputs.
the log division is the softmax function.
$ + \frac{\lambda}{2} \dots $ is a l2 regularization term on the model parameters.