I’m wondering how I could pass functions of the empirical probability distributions of variables into the loss function.
For example imagine a hypothetical scenario where I have a linear layer followed by a ReLU. On its output, I define a binary random variable which equals zero if the output is zero and equals one when the output is non-zero. I want to pass, say the entropy of this binary random variable into my loss function.
Any thoughts on this? Does this have to do with the  distributions  package?