MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / loss_weight

Method loss_weight

trainer/sd3_scheduler.py:155–163  ·  view source on GitHub ↗
(self, sigmas, weight_type: str = 'SNR')

Source from the content-addressed store, hash-verified

153 num_inference_steps, shift_scale, device=device)
154
155 def loss_weight(self, sigmas, weight_type: str = 'SNR'):
156 if weight_type == 'SNR':
157 w = (1 - sigmas)**2
158 raise NotImplementedError(f'Not fully implement SNR: w={w}')
159 elif weight_type == 'min-SNR':
160 w = min((1 - sigmas)**2, 0.5)
161 raise NotImplementedError(f'Not fully implement min-SNR: w={w}')
162 elif weight_type == 'ones':
163 return torch.ones_like(sigmas)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected