MCPcopy Create free account
hub / github.com/Hzfinfdu/Diffusion-BERT / weights

Method weights

diffusion_condition.py:391–398  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

389 self._loss_counts[t] += 1
390
391 def weights(self):
392 if not self._warmed_up():
393 return np.ones([self.num_steps], dtype=np.float64)
394 weights = np.sqrt(np.mean(self._loss_history ** 2, axis=-1))
395 weights /= np.sum(weights)
396 weights *= 0.999
397 weights += 0.001 / len(weights)
398 return weights
399
400 def _warmed_up(self):
401 return (self._loss_counts == self.history_per_term).all()

Callers

nothing calls this directly

Calls 1

_warmed_upMethod · 0.95

Tested by

no test coverage detected