MCPcopy
hub / github.com/jindongwang/transferlearning / entropy

Method entropy

code/deep/CSG/distr/instances.py:245–248  ·  view source on GitHub ↗
(self, conds: edic=edic())

Source from the content-addressed store, hash-verified

243 return reduce_last(tc.sum, logps_all, len(self.shape))
244
245 def entropy(self, conds: edic=edic()) -> tc.Tensor:
246 # [shape_bat, shape_cond] -> [shape_bat]
247 logits = self._logitsfn(conds) # logit == log prob
248 return - reduce_last(tc.sum, logits.exp() * logits, len(self.shape) + 1)
249
250class Bern(DistrElem):
251 def __init__(self, name: str, *, probs = None, logits = None, shape = None, device = None):

Callers 9

_entropyMethod · 0.45
elboFunction · 0.45
elbo_z2xyFunction · 0.45
elbo_z2xy_twistFunction · 0.45
elbo_zy2xFunction · 0.45
elbo_z2xyFunction · 0.45
elbo_z2xy_twistFunction · 0.45
elbo_fixllhFunction · 0.45
elbo_z2xy_twist_fixptFunction · 0.45

Calls 3

_logitsfnMethod · 0.95
edicClass · 0.85
reduce_lastFunction · 0.85

Tested by

no test coverage detected