Open
Description
Hi, thanks for your work.
Should the variable target be equal to target - noise in your flow loss?
This version seems to predict the target sample directly, rather than the velocity.
def forward(self, target, z, mask=None, mask_y=None):
noise = torch.randn_like(target)
t = torch.rand(target.shape[0], device=target.device)
noised_target = t[:, None] * target + (1 - t[:, None]) * noise
predict_v = self.net(noised_target, t * 1000, z)
weights = 1.0 / \
torch.arange(1, self.in_channels + 1, dtype=torch.float32, device=target.device)
if mask_y is not None:
loss = (mask_y * weights * (predict_v - target) ** 2).sum(dim=-1)
else:
loss = (weights * (predict_v - target) ** 2).sum(dim=-1)
if mask is not None:
loss = (loss * mask).sum() / mask.sum()
return loss.mean()
Metadata
Metadata
Assignees
Labels
No labels