MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / __init__

Method __init__

sat/sgm/modules/diffusionmodules/guiders.py:57–68  ·  view source on GitHub ↗
(self, scale, exp, num_steps, dyn_thresh_config=None)

Source from the content-addressed store, hash-verified

55
56class DynamicCFG(VanillaCFG):
57 def __init__(self, scale, exp, num_steps, dyn_thresh_config=None):
58 super().__init__(scale, dyn_thresh_config)
59 scale_schedule = (
60 lambda scale, sigma, step_index: 1 + scale * (1 - math.cos(math.pi * (step_index / num_steps) ** exp)) / 2
61 )
62 self.scale_schedule = partial(scale_schedule, scale)
63 self.dyn_thresh = instantiate_from_config(
64 default(
65 dyn_thresh_config,
66 {"target": "sgm.modules.diffusionmodules.sampling_utils.NoDynamicThresholding"},
67 )
68 )
69
70 def __call__(self, x, sigma, step_index, scale=None):
71 x_u, x_c = x.chunk(2)

Callers

nothing calls this directly

Calls 3

instantiate_from_configFunction · 0.50
defaultFunction · 0.50
__init__Method · 0.45

Tested by

no test coverage detected