Multi-layer Regularization

Hello,
I’m relatively new to Tensorflow, and I’m trying to build my own regularizer that works by taking in weights of some dense layers, flattening and concatenating them, and inputting that into another small MLP, which gives me the regularization penalty. Does anyone know how to implement this kind of multi-layer regularization in tensorflow?