MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / linear_decay

Function linear_decay

train_portrait.py:159–165  ·  view source on GitHub ↗
(initial_value, final_value, total_steps, current_step)

Source from the content-addressed store, hash-verified

157
158
159def linear_decay(initial_value, final_value, total_steps, current_step):
160 if current_step >= total_steps:
161 return final_value
162 current_step = max(0, current_step)
163 step_size = (final_value - initial_value) / total_steps
164 current_value = initial_value + step_size * current_step
165 return current_value
166
167
168def generate_timestep_with_lognorm(low, high, shape, device="cpu", generator=None):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected