Custom regularizer

Would it be possible to calculate a p-norm between the parameters as described here and add it to your loss?