I’m a bit confused, too.
Which activation function do you mean and what would you like to do with this function?
Based on the formula and code you’ve posted, it seems that l_reg is calculated based on the weight matrix of the last linear layer.