MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / get_value

Method get_value

k_diffusion/utils.py:145–149  ·  view source on GitHub ↗

Gets the current EMA decay rate.

(self)

Source from the content-addressed store, hash-verified

143 self.__dict__.update(state_dict)
144
145 def get_value(self):
146 """Gets the current EMA decay rate."""
147 epoch = max(0, self.last_epoch - self.start_at)
148 value = 1 - (1 + epoch / self.inv_gamma) ** -self.power
149 return 0. if epoch < 0 else min(self.max_value, max(self.min_value, value))
150
151 def step(self):
152 """Updates the step count."""

Callers 1

mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected