Formulation for a custom regularizer to minimize amount of space taken by weights

Perhaps L1 penalty (see here) proportional to what you compute would work?