MCPcopy Create free account
hub / github.com/NVlabs/CTG / loss

Method loss

tbsim/models/diffuser.py:1058–1063  ·  view source on GitHub ↗
(self, x, data_batch, aux_info={})

Source from the content-addressed store, hash-verified

1056 return loss, info
1057
1058 def loss(self, x, data_batch, aux_info={}):
1059 batch_size = len(x)
1060
1061 t = torch.randint(0, self.n_timesteps, (batch_size,), device=x.device).long()
1062
1063 return self.p_losses(x, t, data_batch, aux_info=aux_info)
1064
1065 def unravel_index(index, shape):
1066 out = []

Callers 1

compute_lossesMethod · 0.95

Calls 1

p_lossesMethod · 0.95

Tested by

no test coverage detected